These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

[SOLVED] API - Pheal PHP class, CharacterName() Issues

Author
SoC Darkord
Silentium Mortalitas
#1 - 2012-04-25 09:33:23 UTC  |  Edited by: SoC Darkord
Hi all,

im trying to sort out a mailing system as part of a larger website / management thing im doing. Getting the mailing data is fine, thats being stored in the database fine, however, when it comes to getting the Senders name based on the ID (as follows), all i get returned is Invalid ID.

The xml is expecting a comer separated string of valid ID's, in this case im passing it a single id, as its the mails sender it will only ever be a character.

Quote:
$fromcharactername = $pheal->CharacterName($mailnodedata->senderid);


this returns error 126 -> Invalid ID. The id itself is valid, as its taken from an API import, i've checked the data for extra spaces etc, thats all fine, and no trailing comers, well no comers at all as its a single ID.

Has anyone used Pheal to request this information? and if so... help? :P

If it makes any difference, this is being built into a number of Drupal 7 modules.

****Edit:****

I have been using Api Docs

Offering Blackops and Covert services

 Covert bridging / Null sec camp clearing / Null sec Disruption / Anti capital / Covert fleet support

Desmont McCallock
#2 - 2012-04-25 09:45:19 UTC  |  Edited by: Desmont McCallock
Sender can be either character or mailing list. Maybe that's your issue.

Edit: I updated the related page in http://wiki.eve-id.net/APIv2_Char_MailMessages_XML
SoC Darkord
Silentium Mortalitas
#3 - 2012-04-25 09:51:40 UTC  |  Edited by: SoC Darkord
the Receiver can be corp, alliance, mailing list, or char...

if something is send by a char to a mailing list it gets the mailing lists id as sender? I would assuming the sender ID remains that of the char that sent it

i guess if thats the case, the next question is how do i specify what ID im sending the xml? as per the documentation for it:

Quote:
Comma-separated list of ownerIDs (characterID, agentID, corporationID, allianceID, or factionID) and typeIDs to query


So i was assuming, ether it doesn't matter what ID you handed it, so long as its valid, or i have to specify it as follows: (as an example)

Quote:
$fromcharactername = $pheal->CharacterName(array("CharacterID" => $mailnodedata->senderid));


but that doesnt work ether..

I have also tried hard coding a char ID, on its own, and passing as an array with different keys.. including CharacterID, characters, etc

*Edit*

just saw your edit.. reading now :)

Offering Blackops and Covert services

 Covert bridging / Null sec camp clearing / Null sec Disruption / Anti capital / Covert fleet support

SoC Darkord
Silentium Mortalitas
#4 - 2012-04-25 10:01:53 UTC
ok further update:

I re-ran the code with a known Char id, under both of snippits of code i posted above,

both returned this:

Quote:
"Invalid ID found in ID list. Please ensure input is a comma seperated list of valid 32-bit non-negative integers."


so it doesn't seem that mailing list ID is the issue here :/

nice to know that the Wiki is getting updated occasionally though :)

Offering Blackops and Covert services

 Covert bridging / Null sec camp clearing / Null sec Disruption / Anti capital / Covert fleet support

Desmont McCallock
#5 - 2012-04-25 10:05:54 UTC  |  Edited by: Desmont McCallock
I just double checked and yes, sender id can be a mailing list id.
You are passing a mailing list id and that makes the call fail.

If the senderID matches any of the toListID then it's a mailing list id.
SoC Darkord
Silentium Mortalitas
#6 - 2012-04-25 10:44:47 UTC
Ok, so thats definatly a check i need to add before trying to get the name :) Thanks,

However the problem still remains for known char ids, as follows:

I'm passing it this id: 1776939881

That id is currently saved as a char ID, in my database. as it was pulled from the api for my character.

To double check this, i ran a query against the database for all known mailing lists for everyone on the system.

Quote:
select * from evemailinglists where mailinglistid = 1776939881


This returns no results,

However if i run a select * against my char data, for that ID i return the expected character, the ID also appears as expected in my portrait URL on the image server:

https://image.eveonline.com/Character/1776939881_128.jpg

So i agree that i need to add checking for mailing list ID's (easy enough) however, as this id is a char id, the mailing listid is not currently an issue

Offering Blackops and Covert services

 Covert bridging / Null sec camp clearing / Null sec Disruption / Anti capital / Covert fleet support

Desmont McCallock
#7 - 2012-04-25 11:09:44 UTC  |  Edited by: Desmont McCallock
SenderID is not a list of IDs (although come to think of it, it shouldn't matter when calling the CharacterName API call).
If you are passing a list of IDs to the call make sure that it's comma separated correctly.
SoC Darkord
Silentium Mortalitas
#8 - 2012-04-25 11:14:17 UTC
from the functions point of view, it shouldn't matter if its 1 ID or 50, so long as the list is comma separated where there are multiple values.

Its effectively expecting a string of ID's, which is what i'm giving it, the number of ID's shouldn't matter...

Offering Blackops and Covert services

 Covert bridging / Null sec camp clearing / Null sec Disruption / Anti capital / Covert fleet support

Desmont McCallock
#9 - 2012-04-25 11:20:59 UTC  |  Edited by: Desmont McCallock
I believe it does as the max list elements is 250.
http://wiki.eve-id.net/APIv2_Eve_CharacterName_XML wrote:
A hard maximum of 250 IDs passed in. Might change in the future depending on live results.
If an ID is passed into the call that does not resolve the call will not return any results regardless of the validity of other ids
Script should be
$fromcharactername = $pheal->CharacterName(array("ids" => $mailnodedata->senderid));
SoC Darkord
Silentium Mortalitas
#10 - 2012-04-25 11:28:18 UTC  |  Edited by: SoC Darkord
ye, however in this case as its 1 ID i don't think that limit is the issue Cool

as the ID seems correct and I cant find any problems with the data itself, I can only assume that the code I've written is wrong, or at least not passing the data in the expected way...

so I guess the question is, do you or anyone else, have any examples of how the code should be written?

*edit*--------------

Just saw your edit :)

Will try that and let you know,

thanks!

Offering Blackops and Covert services

 Covert bridging / Null sec camp clearing / Null sec Disruption / Anti capital / Covert fleet support

SoC Darkord
Silentium Mortalitas
#11 - 2012-04-25 11:34:24 UTC
Brilliant,

Thats done it, so I was just missing the correct array key.

thanks alot :)

Offering Blackops and Covert services

 Covert bridging / Null sec camp clearing / Null sec Disruption / Anti capital / Covert fleet support