Diablo® III

Retrieveing the info with the API

Hi.

I have a question. How do I actually retrieve the information. I know it says something about a GET request, but the syntax doesn't look too familiar with any programming language I know.

Is it possibly to make it in PHP, and if so how? (how do the syntax look like)

Any help will be appreciated :-).
Edited by DarkruneDK#2331 on 9/6/2012 3:48 PM PDT
Reply Quote
Look into cURL if you're using PHP
http://php.net/manual/en/book.curl.php

Look at some API libraries for World of Warcraft since the WoW API is very similar and there are a ton of free libs out there.
Reply Quote
Look into cURL if you're using PHP
http://php.net/manual/en/book.curl.php

Look at some API libraries for World of Warcraft since the WoW API is very similar and there are a ton of free libs out there.


I will try looking it up, thanks :-).
Reply Quote
For someone that novice with PHP I would recommend this:
https://github.com/XjSv/Diablo-3-API-PHP

Its in PHP and it uses cURL to get the data.

Its very simple for anyone to understand I think. Maybe even a knowledgeable non-programmer.
Edited by XjSv#1677 on 9/9/2012 10:55 AM PDT
Reply Quote
For more advanced usage you can look into https://github.com/jeserkin/d3-api-php.
Reply Quote
For someone that novice with PHP I would recommend this:
https://github.com/XjSv/Diablo-3-API-PHP

Its in PHP and it uses cURL to get the data.

Its very simple for anyone to understand I think. Maybe even a knowledgeable non-programmer.

Hey, i downloaded your setup and loaded it up, I am trying to figure out how exactly to run it, I believe usage.php is the main page however when I look in the code you have your information put into the battle tag area but when I run the project I keep getting "No Data ReturnNo Data ReturnNo Data ReturnNo Data ReturnNo Data ReturnArray ( [CAREER_DATA] => No Data Return )
Proccess finished in 0:0:0 seconds" I assume this is because there is still information I have to enter, any place you have a guide on what to do to get info. Sorry if my question is confusing.
Reply Quote
What is the Battle tag you are using? Perhaps you are trying to query an account from Europe u need to change the second parameter from "us" to "eu".
Reply Quote
09/11/2012 12:47 PMPosted by XjSv
What is the Battle tag you are using? Perhaps you are trying to query an account from Europe u need to change the second parameter from "us" to "eu".
Well at first I was just using yours that was left in, but If i change it to my own Zocheyado#1549 the same happens, Ill try re downloading and putting it on my main computer to see if I can find out whats going on.
Reply Quote
What is the Battle tag you are using? Perhaps you are trying to query an account from Europe u need to change the second parameter from "us" to "eu".
Well at first I was just using yours that was left in, but If i change it to my own Zocheyado#1549 the same happens, Ill try re downloading and putting it on my main computer to see if I can find out whats going on.


It seems to be working fine. Can you tell me a little more about your server setup, php version or anything at all that might help figure out what the problem is.


require_once('diablo3.api.class.php');
$Diablo3 = new Diablo3("Zocheyado#1549", 'us', 'en_US');
$CAREER_DATA = $Diablo3->getCareer();

Results:
Array
(
[heroes] => Array
(
[0] => Array
(
[name] => Zimilo
[id] => 5199194
[level] => 60
[hardcore] =>
[paragonLevel] => 5
[gender] => 0
[dead] =>
[class] => witch-doctor
[last-updated] => 1347423700
)...
Edited by XjSv#1677 on 9/12/2012 7:26 AM PDT
Reply Quote
Using Wamp and Netbeans, php 5.4.3, I have the curl extension enabled. So out of curiosity i redownloaded the zip on my home computer, which has identical setup and tried and I am still getting the same issue, any thoughts? the code looks awesome wish i could use it ^^
Reply Quote
09/12/2012 07:30 AMPosted by Zocheyado
Using Wamp and Netbeans, php 5.4.3, I have the curl extension enabled. So out of curiosity i redownloaded the zip on my home computer, which has identical setup and tried and I am still getting the same issue, any thoughts? the code looks awesome wish i could use it ^^


Can you show me your usage.php code?

Anything in the error_logs?
Edited by XjSv#1677 on 9/12/2012 7:33 AM PDT
Reply Quote
http://pastebin.com/S6qwEFML Nothing in the logs
Reply Quote
09/12/2012 07:37 AMPosted by Zocheyado
http://pastebin.com/S6qwEFML Nothing in the logs


I used your sample and i am getting data back. I am investigating why this wouldn't work in any other scenario/server.


Array
(
[heroes] => Array
(
[0] => Array
(
[name] => Zimilo
[id] => 5199194
[level] => 60
[hardcore] =>
[paragonLevel] => 5
[gender] => 0
[dead] =>
[class] => witch-doctor
[last-updated] => 1347423700
)...
Reply Quote
Okay, let me know if you need anything more from me, would be awesome if i could get this to work
Reply Quote
can you un-comment these lines and see what you get in the error log.


// Debug
//
//error_log("URL: ".$url);
//error_log("HTTP Code: : ".$http_status);
//error_log("Data: ".$data);


It seems to me like either there was a cURL error in which case you would have seen something in the error logs, so if we rule that out then it could mean that the http return status was something other then 200.
Edited by XjSv#1677 on 9/12/2012 8:00 AM PDT
Reply Quote
After un commenting those lines, re running I got the exact same results.
Reply Quote
09/12/2012 08:05 AMPosted by Zocheyado
After un commenting those lines, re running I got the exact same results.


No but now you should have some entries in your error log. Can you show me those?

That should log the URL that was called, HTTP code that was returned and the data if any.
Edited by XjSv#1677 on 9/12/2012 8:08 AM PDT
Reply Quote
Nothing in my php error log, apache log had quite a few curl errors http://pastebin.com/2Qu2em33
Reply Quote
09/12/2012 08:11 AMPosted by Zocheyado
Nothing in my php error log, apache log had quite a few curl errors http://pastebin.com/2Qu2em33


Ohh i see well from the looks of it cURL is defiantly not available? And the fact that you don't see anything in your error logs also means there is some is configuration with your server.
Reply Quote
Hmm, are you using wamp yourself? if so is there anything other then the php curl extension that needs to be activated?
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]