| Pages: [1] :: one page |
| Author |
Thread Statistics | Show CCP posts - 0 post(s) |

rswfire
Firesworn Firesworn Nation
78
|
Posted - 2013.05.21 21:29:00 -
[1] - Quote
Hey, guys (and girls; yes, they really exist In Eve! -- I was surprised too),
I could use some advice...
We use the API on our website to validate members are part of our alliance. If they leave, it will automatically move them to a new group that basically prevents them from access to anything important. If they change their key and are still a member, they get moved to purgatory till they fix the problem. All of this stuff works just fine...until the API goes down! And this seems to happen a lot lately. -.-
If the API goes down, everyone gets pushed into purgatory. This is of course because I'm not confirming the API server is actually up, but I'm not sure what function I should call to do this with. I can't call something like APIKeyInfo because if a user changes their key or removes it, well, they're put into purgatory on purpose.
Is there a function I can call to determine the state of the API that would return an error that I can reliably use that is not dependent on what another member's key status might be?
Thanks in advance. Fire http://www.youtube.com/watch?v=ZYAz0aWEzpw
http://www.firesworn.com/index.php?/topic/69-about-firesworn-nation/
|

Wolf Kolona
Ghost Headquarters The Ghost Army
66
|
Posted - 2013.05.21 21:33:00 -
[2] - Quote
You should press the 'Any key'! -The Ghost Army- Mercs For Hire |

rswfire
Firesworn Firesworn Nation
79
|
Posted - 2013.05.21 21:42:00 -
[3] - Quote
Wolf Kolona wrote:You should press the 'Any' key!
Haha! You're funny, Wolf. <3 http://www.youtube.com/watch?v=ZYAz0aWEzpw
http://www.firesworn.com/index.php?/topic/69-about-firesworn-nation/
|

Steve Ronuken
Fuzzwork Enterprises
1434
|
Posted - 2013.05.21 22:03:00 -
[4] - Quote
Use character info (I'm assuming this is the main one you check, anyway)
Check the return status of the request, as it should return an error code, when there's an issue, rather than an empty dataset.
I'm not sure what language you're using, but if it's php, take a look at using curl, rather than using one of simple xml functions, for getting the document.
That way, you can build error handling in.
There's an example of how to use curl at the bottom of: http://www.fuzzwork.co.uk/2013/05/06/using-the-eve-central-api-with-php/
Assuming it's turned on in your install, that is. It's for eve central, but the basic principle is the same. Steve Ronuken for CSM 9!-á I'm starting early :) Handy tools and an SDE conversion Twitter: @fuzzysteve on Twitter |

rswfire
Firesworn Firesworn Nation
79
|
Posted - 2013.05.21 22:18:00 -
[5] - Quote
Steve Ronuken wrote:Use character info (I'm assuming this is the main one you check, anyway) Check the return status of the request, as it should return an error code, when there's an issue, rather than an empty dataset. I'm not sure what language you're using, but if it's php, take a look at using curl, rather than using one of simple xml functions, for getting the document. That way, you can build error handling in. There's an example of how to use curl at the bottom of: http://www.fuzzwork.co.uk/2013/05/06/using-the-eve-central-api-with-php/Assuming it's turned on in your install, that is. It's for eve central, but the basic principle is the same.
Thanks. I am in fact using simplexml (just put something together very quickly) and have considered switching to cURL in order to get a status code returned. I thought about this and I can use my own key since I don't ever change it, so if it returns an error, I can trust the issue is on the API side. I'll check out the link also. Appreciate the advice. http://www.youtube.com/watch?v=ZYAz0aWEzpw
http://www.firesworn.com/index.php?/topic/69-about-firesworn-nation/
|

rswfire
Firesworn Firesworn Nation
79
|
Posted - 2013.05.21 23:15:00 -
[6] - Quote
If the API is having issues, can it return an error code of 203 (authentication failure)?
I am receiving this both from my own code and from doing it in a browser and I have verified the credentials are correct.
I would, of course, expect it to return a 5xx if it was on the API side. I just want to rule out my own code.
Given I receive the same error from a direct link in my browser, I suspect it is an API issue. Can anyone confirm? http://www.youtube.com/watch?v=ZYAz0aWEzpw http://www.firesworn.com/index.php?/topic/69-about-firesworn-nation/
|

rswfire
Firesworn Firesworn Nation
79
|
Posted - 2013.05.21 23:17:00 -
[7] - Quote
Sigh. Sorry, it's me. Using the wrong parameters. http://www.youtube.com/watch?v=ZYAz0aWEzpw http://www.firesworn.com/index.php?/topic/69-about-firesworn-nation/
|

rswfire
Firesworn Firesworn Nation
79
|
Posted - 2013.05.21 23:26:00 -
[8] - Quote
Okay, all of my issues are resolved.
I know some people are using classes and tools from other community developers, but I did not find any that I really wanted to use. I've created a simple PHP class using cURL that isn't much different than some of them. I am a bit OCD about code, so this will be overkill to some. In case it is of some value to anyone, you can take a look at it in the link below. Open source, no license restrictions, etc.
http://pastebin.com/nRbVxLSH
Note, I prefer to work with arrays, so I convert the XML object to an array. If you prefer to use the former, remove line 72 and replace line 73 with $xmlResult instead of $arrResult. You can also completely remove the private function ObjectToArray() if you do this. http://www.youtube.com/watch?v=ZYAz0aWEzpw http://www.firesworn.com/index.php?/topic/69-about-firesworn-nation/
|

Dimitrie
Free-Space-Ranger Nulli Secunda
3
|
Posted - 2013.05.22 06:46:00 -
[9] - Quote
EVE-ALE Library, its simple to use. https://forums.eveonline.com/default.aspx?g=posts&m=125817#post125817 |
| |
|
| Pages: [1] :: one page |
| First page | Previous page | Next page | Last page |