Request for API Extension

Concerns? Let us know by posting here.

Moderators: avij, Phaseolus, Fons, dserrano5

User avatar
ernie_hh
Euro-Regular
Euro-Regular
Posts: 205
Joined: Mon Jan 30, 2006 7:37 am
Location: Hamburg, DE
Contact:

Request for API Extension

Post by ernie_hh »

Hallo,

i like to file a request for a few new functions on the EBT-API. As some User parse the Web pages to generate statistics, i think it would be a good point to make the profiles available via the API.

Of course all the data-caching for the web pages should also apply for the following API-calls to not kill the database. Login should not be necessary for most of the calls.

I would like to have an API-call to get all the information about a given user. The parameter should be the user id. The reply should be a JSON-Hash with the values available on the page:
  • user id
  • user name
  • hit count
  • notes entered
  • date of registration
  • city id / city name (language?)
  • country id / country name (language?)
  • time stamp of last note
  • (position on city/country/ebt-list, not sure about that)
The same request applies to the other profiles found on the page, namely:
  • city profile
  • region profile
  • country profile
  • note profile (with additional information if logged in, like a flag, if the note was already edited or not)
In a last step it would be great, if the lists of ebt would also be available as JSON the simplify the parsing for clients:
  • user-csv (login required)
  • zensored-user-csv (key required)
  • hit-csv (really neccessary?, i think half of the list is unneeded anyway)
  • user-rankings
  • city-ranking
  • hit-ranking
More ideas:
  • all clients should use the https-version of the API, the http-version should be marked as deprecated.
  • all clients should get a unique ID and identify themselves against the API


As this is quite a big set of request I would like to see them as a kind of time line. So in my opinion the priority could be from the top (more important) to the bottom (less important).

So whats your opinion?

greetings
ernie
EBT-Statistiken und Dotkonverter: http://euro.ernie-hh.de/" onclick="window.open(this.href);return false;
Aktuelle EBT-Tool-Version: 0.99.11.3 vom 11.01.2011
News im EBT-Blog: http://euro.ernie-hh.de/blog/" onclick="window.open(this.href);return false;
User avatar
dserrano5
Euro-Master
Euro-Master
Posts: 3773
Joined: Sun Jan 31, 2010 11:59 am
Location: Madrid, ES

Re: Request for API Extension

Post by dserrano5 »

ernie_hh wrote:
  • user id
  • user name
  • hit count
  • notes entered
  • Notes entered by denomination.
ernie_hh wrote:
  • date of registration
  • city id / city name (language?)
  • country id / country name (language?)
  • time stamp of last note
  • (position on city/country/ebt-list, not sure about that)
User avatar
googlejaps
Euro-Master
Euro-Master
Posts: 3228
Joined: Thu Sep 11, 2008 9:12 pm
Contact:

Re: Request for API Extension

Post by googlejaps »

I also need an extension of the API like described. When I update the ranking of this game it takes me over 5 hours. If I could automatize this with the EBT API I could do this in much less time!
User avatar
marty44
Euro-Expert
Euro-Expert
Posts: 685
Joined: Tue Jun 27, 2006 12:33 pm
Location: Mainz, Germany
Contact:

Re: Request for API Extension

Post by marty44 »

I would also like some extensions for the API.

I'm just playing around with a Cisco 7970 VoIP phone and would like to write a little XML site for. It should display the username, entered notes, hits and the last hit.
These four requests should be accessable via the API without authentification.

should be something like this:

http://www.eurobilltracker.com/API/api. ... sername&v=" onclick="window.open(this.href);return false;<version>&userid=80060

it should look like this at the phone
Attachments
sample output
sample output
ciscoebtphone.jpg (209.36 KiB) Viewed 7110 times
User avatar
Nerzhul
Euro-Master
Euro-Master
Posts: 1417
Joined: Tue Apr 27, 2004 12:33 am
Location: Berlin

Re: Request for API Extension

Post by Nerzhul »

I finally got around to release two of the requested API functions: globalstats_profile_note and globalstats_profile_user which allow you to retrieve public note/user data. See the documentation at api.eurobilltracker.com for details.

I plan on adding more functions (public city/region/country info) later when I get around, but development is moving at glacial speed now because I started working full time again.

Also I had to draw a cut somewhere what info we want to return about a user. Some public stats are currently left out (list of hitpartners, list of hits, your connection etc.) as I think these are better served by special methods. But this is more a design/philosophy issue, feel free to convince me otherwise. :-)

Please note that API access via HTTP is now deprecated! Fear not, we will support HTTP for quite a while, but please migrate your apps and clients to HTTPS when possible.

I'd also like to clarify our method versioning scheme. A method will only get a new version if there are changes to the semantics or signature or if fields are removed from the output. Specifically, new output fields won't result in a new version, e.g. if we add a field like total_international_hits to the globalstats_profile_user method the version will remain as is.

Please adjust your code accordingly. The API JSON output should be fed to a parser library so your program only needs to access object properties. If you're manually parsing for the 15th comma in a string you're most likely doing something wrong.
EBT Webmaster | Author of the EBT-Tool | Dothunter! | EBT News on Twitter
User avatar
dserrano5
Euro-Master
Euro-Master
Posts: 3773
Joined: Sun Jan 31, 2010 11:59 am
Location: Madrid, ES

Re: Request for API Extension

Post by dserrano5 »

"Notes entered by denomination" doesn't seem to be implemented. We receive whether the user is sharing their stats or not, but there's no access to those stats.

Besides this, the parameter PHPSESSID is optional in these new methods.
User avatar
androl
Euro-Master
Euro-Master
Posts: 4318
Joined: Sun Feb 08, 2004 1:20 pm
Location: München (Myeenack, Mjuncken), Deutschland (Chairmany, Djutschländ)
Contact:

Re: Request for API Extension

Post by androl »

timestamp_adjusted doesn't seem to work for time_offset=0 (UK, Ireland) or time_offset=3.5 (Iran)

https://api.eurobilltracker.com/?m=glob ... e_offset=0" onclick="window.open(this.href);return false;
https://api.eurobilltracker.com/?m=glob ... e_offset=1" onclick="window.open(this.href);return false;
https://api.eurobilltracker.com/?m=glob ... e_offset=2" onclick="window.open(this.href);return false;
https://api.eurobilltracker.com/?m=glob ... e_offset=3" onclick="window.open(this.href);return false;
https://api.eurobilltracker.com/?m=glob ... offset=3.5" onclick="window.open(this.href);return false;

also, is there an easy way to transform the output encoding to the input encoding? Like, when the city search gives {"city":"M\u00fcnchen","country":"Germany","top_zipcode":"80335","nrlocations":"11"}, and I want to use myzipcodes with
https://api.eurobilltracker.com/?m=myzi ... 6789&city=" onclick="window.open(this.href);return false;M%C3%BCnchen&country=Germany&comment=
or could you make that
https://api.eurobilltracker.com/?m=myzi ... 6789&city=" onclick="window.open(this.href);return false;M\u00fcnchen&country=Germany&comment= also works?

flag_url gives complex html output
https://api.eurobilltracker.com/?m=glob ... e_offset=1" onclick="window.open(this.href);return false;
"flag_url":"<img border='0' src='\/img\/flags\/1.gif' width='15' height='10' name='flag_for_1' alt='Flag for ' title=''>"
shouldn't it be just
"flag_url":"\/img\/flags\/1.gif" ?
All returned data is JSON and UTF-8 encoded. All input parameters must be properly encoded.
I think this is wrong, \u00fc is not a UTF-8 encoding. %C3%BC is UTF-8 percent-encoding
Joshu, a Chinese Zen master, asked a cow:
"Do you have Buddha-nature or not?"
The cow answered: "Moo."
User avatar
Nerzhul
Euro-Master
Euro-Master
Posts: 1417
Joined: Tue Apr 27, 2004 12:33 am
Location: Berlin

Re: Request for API Extension

Post by Nerzhul »

androl wrote:timestamp_adjusted doesn't seem to work for time_offset=0 (UK, Ireland) or time_offset=3.5 (Iran)
Offset 0 has been fixed. Surprisingly PHP considers (0 == "") to be true :roll:

Currently we don't support floating point offsets, sorry about that. I guess if there's a real need I could work on that but I'd like to keep the EBT code simple.
androl wrote:flag_url gives complex html output
https://api.eurobilltracker.com/?m=glob ... e_offset=1" onclick="window.open(this.href);return false;
"flag_url":"<img border='0' src='\/img\/flags\/1.gif' width='15' height='10' name='flag_for_1' alt='Flag for ' title=''>"
shouldn't it be just
"flag_url":"\/img\/flags\/1.gif" ?
Fixed.
androl wrote:
All returned data is JSON and UTF-8 encoded. All input parameters must be properly encoded.
I think this is wrong, \u00fc is not a UTF-8 encoding. %C3%BC is UTF-8 percent-encoding
Hmmm, I'm not sure if this is a bug. \u00fc is working fine (you can easily try out with http://json.parser.online.fr/" onclick="window.open(this.href);return false;), but I'm not an expert in this matter and just relying on a third party library to do the encoding. Are you experiencing any problems or is this just an academical nitpick? ;-)

Anyway, thanks for spotting the bugs. You'd make a great tester in my team :-)
EBT Webmaster | Author of the EBT-Tool | Dothunter! | EBT News on Twitter
User avatar
marty44
Euro-Expert
Euro-Expert
Posts: 685
Joined: Tue Jun 27, 2006 12:33 pm
Location: Mainz, Germany
Contact:

Re: Request for API Extension

Post by marty44 »

I have now a first version ready, see screenshot below. I want to take it online to my webspace next week (provider will do first an upgrade of php first)

Is there any api method to get the note id of the last hit? (and without logging in)
Attachments
Screenshot.png
Screenshot.png (15.47 KiB) Viewed 6531 times
User avatar
marty44
Euro-Expert
Euro-Expert
Posts: 685
Joined: Tue Jun 27, 2006 12:33 pm
Location: Mainz, Germany
Contact:

Re: Request for API Extension

Post by marty44 »

After my provider updated PHP, etc, the small XML service for Cisco phones is now online. It gives a quick overview of your account (all fetched via the globalstats_profile_user api)
Since there is no api method to get noticed if the user has a hit since login or not, it maintains a small database behind.

If you have a Cisco phone, you can add this XML service via the <servicesURL></servicesURL> tag of your SEP....conf file. I have testet it with a Cisco 7970, other Cisco phones might work too.

here is the string (replace 923456 with your ebt userid):
<servicesURL>http://www.arbeitsplatzvernichtung-durc ... ervicesURL>

if you want to have the timeoffset set (e.g. 1 for Germany, see https://api.eurobilltracker.com/doc/api ... ofile.html" onclick="window.open(this.href);return false; for more info), use this:
<servicesURL>http://www.arbeitsplatzvernichtung-durc ... ervicesURL>

marty
Attachments
ebtcisco.png
ebtcisco.png (15.42 KiB) Viewed 6475 times
User avatar
m_vw
Euro-Regular in Training
Euro-Regular in Training
Posts: 146
Joined: Mon Apr 01, 2002 3:57 pm
Location: Lewedorp, The Netherlands

Re: Request for API Extension

Post by m_vw »

Marty,

Which function do you use to get the status info (like last note entered on...)?

Never mind, found it.

Maurice
My first Note
My Stats (updated 2020.08.13)
User avatar
marty44
Euro-Expert
Euro-Expert
Posts: 685
Joined: Tue Jun 27, 2006 12:33 pm
Location: Mainz, Germany
Contact:

Re: Request for API Extension

Post by marty44 »

Hello,

I have an API request. Would it be possible to change globalstats_profile_user?
It would be nice, if there would be three elements which contains the note numbers of the the last three hits.

marty
SeanW
Euro-Regular in Training
Euro-Regular in Training
Posts: 132
Joined: Tue Jan 04, 2011 11:33 am

Re: Request for API Extension

Post by SeanW »

Hi;

I've been toying with the idea of making a Facebook app for EBT using this API. And I'd like to request that it be extended to include a mechanism for signing up, so that an EBT player account could be set up via on off-site page.

BTW, has anyone tried doing anything with this using JSP/Servlets?
User avatar
m_vw
Euro-Regular in Training
Euro-Regular in Training
Posts: 146
Joined: Mon Apr 01, 2002 3:57 pm
Location: Lewedorp, The Netherlands

Re: Request for API Extension

Post by m_vw »

Would it be possible to include the date/time a note was entered in the reply string of the insert note command?
My first Note
My Stats (updated 2020.08.13)
User avatar
marty44
Euro-Expert
Euro-Expert
Posts: 685
Joined: Tue Jun 27, 2006 12:33 pm
Location: Mainz, Germany
Contact:

Re: Request for API Extension

Post by marty44 »

It looks like that the API will not be improved :(
Post Reply

Return to “Feedback and Development”