API v2 info/documentation

Hi there,

I saw there was now info available for the v2 api, but i was wondering if this info is complete/correct or the v2 api is not up yet?

I tried what was mentioned in the info under my account for v2 but what ever i try i get a 404 for the api url (currently trying the client/public section).

I am not sure but the url listed is https://warcraftlogs/api/v2/x, should this not be https://warcraftlogs.COM/api/v2/x ? or also a port added like v1? i tried all the url setups i can think of, no .com, with .com, with a port, with no port. without .com is does not find the host ofc and with .com and with or without a port i get a 404 for the v2 api.

I am using the insomnia client as suggested (with the oauth2.0 flow/token), and first off i get an ssl error, and then without ssl verification its a 404.

Any info or assistance would be appreciated for the v2 api.

Cheers.

v2 is still under development, so not really ready for production code yet. And yeah it should be warcraftlogs.com in the docs, will fix.

Cheers for the response.

Might i suggest that if it’s not ment to be “used/played with” yet, to remove any mention of the v2 api?
Right now it looks like v2 is up and usable/viewable.

I was trying to see what endpoints where available, but how i read it nothing for the v2 api is live yet, including checking out its schema’s?

It is available. Follow the instructions in client credentials flow, use curl etc. to get an access token and then set your Authorization header to have the bearer access token in Insomnia.

In case anyone is still confused about the URL, it’s https://{site}.warcraftlogs.com/api/v2/client

For example, https://classic.warcraftlogs.com/api/v2/client

This brings me to the main classic warcraftlogs page, anyone else?

Hi there, I was interested in using the API to get some logs into an automation tool I’m trying to develop. Where can I get API documentation, i.e. samples, how-to’s, etc.?

v2 documentation appears inside whatever GraphQL tool/app you use.

Thanks for your quick reply. I’m using GraphQL Editor online just to play around, tried to load the schema from https://classic.warcraftlogs.com/api/v2/client and got the below error.

image

I’m most likely using the wrong schema URL, amirite?

I’m getting an empty response when I do the same. I seem to have a valid client token and was expecting schema info. Hopefully someone has some help here?

I’m experiencing the same thing, did you happen to figure it out? I’m a bit newbie at graphql but not sure what could be messing up my queries. I curled for an access token, posted it and using the schema to try to get any data coming back and everything is just a [] response.

I’m trying to access the v2 documentation too. I’m successful with the call to get an authorization token but when I call the url provided (https://www.warcraftlogs.com/api/v2/client) I just get a 302 Redirect to the home page. I’m using PHP: -

// Get an access token
$curl = curl_init();
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, array(
    'grant_type' => 'client_credentials',
    'client_id' => '????',
    'client_secret' => '????'
    ));
curl_setopt($curl, CURLOPT_URL, 'https://www.warcraftlogs.com/oauth/token');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
$resultObject = json_decode($result, true);
// Call the API
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'authorization' => 'bearer ' . $resultObject['access_token']
));
curl_setopt($curl, CURLOPT_URL, 'https://www.warcraftlogs.com/api/v2/client');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($curl);
?>```

make sure to add a json accept header.

I was able to run using Insomnia and using graphql queries. Something along the lines of:

Got the token using simple curl:

curl -u client_id:secret -d grant_type=client_credentials https://www.warcraftlogs.com/oauth/token

And added both headers:

image

Hello @Kihra! I just tried to get a documentation of v2 API access points. I’m using Insomnia client and was able to get Access Token, but struggling to get any response from https://warcraftlogs.com/api/v2/client. I did 2 headers as @caio did, but am not able to get a response from a server, it just says “Site not found”. Could you help me here?

It might be nice as well, if you list API access points on some page as it was for v1. I want to try and fetch some data for a small app for my guild with Python. Thanks!

1 Like

Don’t leave off the www.

Hi, I’m looking to use the GraphQL schema to retrieve all historical attendance data for a guild.

I can see that there is a has_more_pages field that returns a bool but I’m not sure how to iterate over the pages, essentially a GQL where statement that keeps running until has_more_pages returns false. Hoping someone can give me some advice, at the moment I’m just using the below code to manually pull the pages back.

{
  guildData {
    guild(
      id:486350
    )
    {
      name
      attendance(page:1){data{zone{name},code,players{name}}}
    }
  }
}

Hello, I am trying to retrieve the positioning data of bosses, but it appears that the API does not return this information . Are there plans for this data to be something that can be grabbed through the API? Or am I simply oblivious (I’m still very new to interacting with APIs so it’s entirely possible I’m just looking in the wrong place for this data)?

Thanks!

Position data is in the events in resources.

1 Like

Hi. @Khira, I was able to use GraphQL, but didn’t found, how (given a report link) I get an information about all characters e.g. their specs, covenants, etc used on a given encounter ( just like one gets by looking at Summary at the web site). All I was able to retrieve were classes, but not specs etc. Would you please give me a hand at this, if it works this way at all?