hamlog api

37 views
Skip to first unread message

Barry Keal

unread,
Nov 28, 2014, 5:07:01 AM11/28/14
to clou...@pignology.net
Firstly, I love hamlog for android when I am out mobile, so useful for logging contacts at the time.

Is there a documented api to add new contacts and to retrieve log entries? What I'd like to do is sync it with the database on my web site.

73 Barry

Barry Keal

unread,
Mar 10, 2015, 4:27:59 AM3/10/15
to clou...@pignology.net
bump

Barry Keal

unread,
Mar 16, 2015, 4:05:02 AM3/16/15
to clou...@pignology.net
bump

On Friday, 28 November 2014 10:07:01 UTC, Barry Keal wrote:

Charley Socci

unread,
Mar 16, 2015, 4:24:38 PM3/16/15
to Barry Keal, CloudLog
Ham log uses the ADIF standard - the web site is an API; you could write your own code, probably not too difficult to script with BASH in a Linux shell. Optionally there are add-ons for Windows like wget and curl which would get the job done. Its all php and javascript. Script the login to send your username and password (its NOT SSL by the way), script the selection of your ADIF to upload, or log to export, then upoload, etc, etc... Using the methods which are in black and white in the code on the Hamlog site.

There isn't much to write an API for. They already provide an import and export function and all the code, variables, methods are in the javascript and php files. It can all be scripted, but requires some handiness with scripting, it would be a nice plus if someone would put it into a GUI so you could schedule an automatic export, and import from file A to file B. If you want Ham Radio Deluxe to upload automatically to Hamlog, you'd need to talk to HRD or write a script/utility yourself. Since each site (eQSL, LoTW, HRD, etc - all have their own way of doing things, different platforms, different languages, and they CHANGE from time to time, this is a bit o a PITA - I remember when HRD Utilities broke for eQSL because eQSK changed some parameter in the download code - Since there are so many combinations.

Can you give an idea exactly what you would like to do? (I'd like to automatically upload from my HRD log to Hamlog, or I'd like Ham Log to sync with LoTW (it already does eQSL - which give you yet another option for downloading/merging, etc)

You can always manually import and export ADIFs fromt the website, or from your device using CloudSync - have you used CloudSync2?

Here isa exportadif.php which is the code you run on the server from your browser when you export hamlog cloud log to an ADIF File:

You can look under the hood like this using Chrome and the "Inspect Element" feature. (Right Click, Inspect Element)

<start code sinp (delete me, copy what is in between)>
 <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-24325716-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
  <head>
    <LINK href="/style.css" rel="stylesheet" type="text/css">
    <title> HamLog Access </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <LINK href="style.css" rel="stylesheet" type="text/css">
    <meta name="description" content="Amateur Radio Logging and Tools" />
    <meta name="keywords" content="amateur, ham, radio, log, logging, adif, gridsquare" />
    <script type="text/javascript">    
      
      function showSignUp( whichLayer )
      {       
        var loginform, whatisthis, news;
        loginform = document.getElementById('loginform');
        loginform.style.display = 'none';
        news = document.getElementById('news');
        news.style.display = 'none';
        whatisthis = document.getElementById('whatisthis');
        whatisthis.style.display = 'none';
        var elem, vis;
        if( document.getElementById ) // this is the way the standards work
          elem = document.getElementById( whichLayer );
        else if( document.all ) // this is the way old msie versions work
            elem = document.all[whichLayer];
        else if( document.layers ) // this is the way nn4 works
          elem = document.layers[whichLayer];
        vis = elem.style;
        // if the style.display value is blank we try to figure it out here
        if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
          vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
          vis.display = (vis.display==''||vis.display=='block')?'none':'block';
      }
    </script>
    
  </head>
  <body style="font-family:verdana" OnLoad="document.login.uid.focus();">
  <p> </p>
  <center>
  <table width="100%">
  <tr>
  <td class="nb" colspan="2">
  <div class="logintitle"><img src="/HL_Logo_57x57.png"> HamLog CloudLog</div><br>
  </td>
  </tr>
<tr><td colspan="4" class="nb"><div class="mtext">Global Contact Count: 513343</td></tr>
<tr><td colspan="4" class="nb"><font color="red"><div style="font-size:large;">PLEASE NOTE<br>Use the CloudSync v2 tool in HamLog.<br>The original CloudSynch tool does not send contacts logs to this database.<td></tr>
  <tr>
  
  <td class="nb" width="66%">

  <div id="whatisthis"> 
  <center>
  <table><tr><td width="50%" class="nb">
  <table width="100%"><tr><td class="nb">
  <div class="border"><br>
  <a href="/whatisthis/" class="header" style="text-decoration:none;">What is CloudLog?</a>
  <br><br>
  </div>
  </td></tr>
  </table>
  </td><td width="50%"  class="nb">
  <table width="100%"><tr><td class="nb">
  <div class="border"><br>
  <a href="javascript:showSignUp('signup');" class="header" style="text-decoration:none;">Free Sign Up</a>
  <br><br>
  </div>
  </td></tr>
  </table>
  </td></tr>
  <tr><td width="100%" colspan="2" class="nb">
  <table width="100%"><tr><td class="nb">
  <div class="border"><br>
  <a href="http://pignology.net/?p=94" class="header" style="text-decoration:none;">HamLog App</a>
  <br><br>
  </div>
  </td></tr></table>
  </td></tr></table>
  
  </div>
  </td>
  
  <td class="nb" width="34%">
  <div id="loginform">
  <center>
  <form method="post" name="login" action="/exportadif.php">
    <table style="font-size:100%;">
    <tr>
    <td colspan="2" style="border:0;"> </td>
    </tr>
    <tr>
    <td colspan="2" style="border:0; text-align:left;"><div class="header" style="padding:0px;">User ID: </td>
    </tr>
    <tr>
    <td colspan="2" style="border:0;"><input type="text" name="uid" size="30" autocorrect="off" /></td>
    </tr>
    <tr>
    <td colspan="2" style="border:0; text-align:left;"><div class="header" style="padding:0px;">Password:</td>
    </tr>
    <tr>
    <td colspan="2" style="border:0;"><input type="password" name="pwd" SIZE="30" autocorrect="off" /></td>
    </tr>
    <tr>
    <td style="text-align:right;border:0;" colspan="2"><input type="submit" value="Log in" /></td>
    </tr>
    </table>
  </form>
  </td>
  </tr>

  <tr>
    <td class="nb" colspan="2">
    <div id="news"> 
    <div class="border">
    <div style="text-align:left">
    <div class="header">Recent News from N3WG</div><br>
    <table width="100%"><thead><th>Date</th><th>News</th></thead><tbody>
    <tr><td class="nb" width="15%" style="text-align:left">2014-12-03 13:01:32</td><td class="nb" width="85%" style="text-align:left">Fixed issues with session timeouts.</tr>
<tr><td class="nb" width="15%" style="text-align:left">2014-06-15 18:31:16</td><td class="nb" width="85%" style="text-align:left">Added HamQTH callsign lookup support.<br>Added sort by id option.</tr>
<tr><td class="nb" width="15%" style="text-align:left">2013-08-21 14:47:42</td><td class="nb" width="85%" style="text-align:left">Hard disk in server failed, restored from back taken on 20130819.</tr>
<tr><td class="nb" width="15%" style="text-align:left">2013-08-03 19:20:52</td><td class="nb" width="85%" style="text-align:left">Subscriptions are now per year and paid through http://shop.pignology.net. </tr>
<tr><td class="nb" width="15%" style="text-align:left">2013-08-03 19:18:46</td><td class="nb" width="85%" style="text-align:left">Re-enabled web access.  This web interface no longer shows CloudSynch contacts due to that unfortunate billing issue with Amazon.  It operates with an independent database now.  I understand this is a step backwards but it will have to do for now. </tr>
<tr><td class="nb" width="15%" style="text-align:left">2013-02-16 01:42:11</td><td class="nb" width="85%" style="text-align:left">Viewing all records has been temporarily disabled to address a serious issue.</tr>
<tr><td class="nb" width="15%" style="text-align:left">2012-01-18 01:17:14</td><td class="nb" width="85%" style="text-align:left">Fixed bug in band conversion for 17M.<br>Import ADIF will now set freq when only <BAND> is provided.<br>Added 4M band</tr>
<tr><td class="nb" width="15%" style="text-align:left">2011-11-16 13:26:24</td><td class="nb" width="85%" style="text-align:left">Added a page to allow for API style downloading of your log in ADIF format. It uses HTTP Basic Authentication meaning you can script the download of it if you want.  The page is http://hamlog.it/apiadif.php.</tr>
<tr><td class="nb" width="15%" style="text-align:left">2011-10-04 12:50:22</td><td class="nb" width="85%" style="text-align:left">Chrome Web Store App Created - <a href="https://chrome.google.com/webstore/detail/phmjlfdjndnoenndkdlajcdkahgckphc?hc=search&hcp=main">Web Store Link</a></tr>
<tr><td class="nb" width="15%" style="text-align:left">2011-09-01 15:16:24</td><td class="nb" width="85%" style="text-align:left">Login page redesign</tr>
    <tr><td colspan="3" class="nb"></td></tr>
    </tbody>
    </table>
    </div>
    </div>
    </div>
    </td>
    </tr>

  </table>
  <br>
  </div>
  
  <div id="signup">
  <center>
<div class="header">New User Registration Form</div>
<p><font color="orangered" size="+1"><tt><b>*</b></tt></font>
   indicates a required field</p>
<form method="post" action="http://hamlog.it/signup.php">
<table border="0" cellpadding="0" cellspacing="5">
    <tr>
        <td class="nb" align="right">
            User ID
        </td>
        <td class="nb">
            <input name="newid" type="text" maxlength="100" size="25" />
            <font color="orangered" size="+1"><tt><b>*</b></tt></font>
        </td>
    </tr>
    <tr>
        <td class="nb" align="right">
            Password
        </td>
        <td class="nb">
            <input name="newpassword1" type="password" maxlength="100" size="25" />
            <font color="orangered" size="+1"><tt><b>*</b></tt></font>
        </td>
    </tr>
    <tr>
        <td class="nb" align="right">
            Password AGN
        </td>
        <td class="nb">
            <input name="newpassword2" type="password" maxlength="100" size="25" />
            <font color="orangered" size="+1"><tt><b>*</b></tt></font>
        </td>
    </tr>
    <tr>
        <td class="nb" align="right">
            Callsign
        </td>
        <td class="nb">
            <input name="newcallsign" type="text" maxlength="100" size="25" />
            <font color="orangered" size="+1"><tt><b>*</b></tt></font>
        </td>
    </tr>
    <tr>
        <td class="nb" align="right">
            E-Mail Address
        </td>
        <td class="nb">
            <input name="newemail" type="text" maxlength="100" size="25" />
            <font color="orangered" size="+1"><tt><b>*</b></tt></font>
        </td>
    </tr>
    <tr>
        <td class="nb" align="right">
            Disclaimer
        </td>
        <td class="nb">
            <input type="checkbox" name="disclaimer" value="accepted" /> I accept the terms of the<br><a href="http://hamlog.it/disclaimer.php">HamLog Disclaimer</a>.
            <font color="orangered" size="+1"><tt><b>*</b></tt></font>
        </td>
    </tr>
    <tr>
        <td class="nb" align="right" colspan="2">
            <hr noshade="noshade" />
            <input type="reset" value="Reset Form" />
            <input type="submit" name="submitok" value="   Submit   " />
        </td>
    </tr>
</table>
    
</form>
</div>


  <br>
  
  

  </center>
  </body>
  </html>
<end code snip (delete me)>


To unsubscribe from this group and stop receiving emails from it, send an email to cloudlog+u...@pignology.net.



--
Charley Socci   Musician, Saxophone, Flute and Clarinet
photo
Address: 155 Penfield Hill Road, Portland, CT 06480
  

Charley Socci

unread,
Mar 16, 2015, 4:59:23 PM3/16/15
to Barry Keal, CloudLog
You can use wget at the command line to download your log: (wget is a tool for downloading files from the command line, which also means you can include it or call it from other utilities, programs, or scripts)

type: wget <yourlogin>:<yourpassword>@hamlog.it/apiadif.php (this is the same for any OS you might be using) do not include the <> symbols e.g. http://k1dnr:pass...@hamlot.it/apiadif.php

Now that you can do that, you could put that command into a file called (getmyhamlog.bat) and use Windows Task Scheduler to run it at a particular time everyday -

You will need to install wget for Windows or Mac or whatever from https://www.gnu.org/software/wget/

wget is usually included in most Linux distros, Mac has some options (http://www.macports.org/ports.php?by=name&substr=wget), or you can compile the source directly on your Mac using terminal.

You will need to add the path to wget.exe in Windows, or run it from the same directory c:\Program Files\GnuWin32\bin\wget.exe or c:\Program Files (x86)\GnuWin32\bin\wget.exe

Or download the zipped version, and run it from whatever folder you choose. This is a command line utility, not a GUI - but very easy to use.

Example:

c:\Program Files (x86)\GnuWin32\bin>wget http://k1dnr:mypas...@hamlog.it/apiadif.php
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = c:\Program Files (x86)\GnuWin32/etc/wgetrc
--2015-03-16 16:42:20--  http://k1dnr:*password*@hamlog.it/apiadif.php
Resolving hamlog.it... 74.208.185.139
Connecting to hamlog.it|74.208.185.139|:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to hamlog.it|74.208.185.139|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: `apiadif.php'

    [  <=>

2015-03-16 16:42:21 (375 KB/s) - `apiadif.php' saved [84305]


The file will be saved to the same directory you ran wget from, but read the manual for wget or type wget --help to get all the options (there are many)

On Mon, Mar 16, 2015 at 4:05 AM, Barry Keal <ba...@keal.me.uk> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to cloudlog+u...@pignology.net.

Charley Socci

unread,
Mar 16, 2015, 5:04:45 PM3/16/15
to Barry Keal, CloudLog
Feel free to email me directly if you have any general questions about scripting or creating a batch file/scheduled task, etc... I'm not affiliated with HamLog - just another ham. Maybe I can help you figure something out.

Charley Socci  K1DNR Owner, Centerbrook Technology LLC


Website: http://www.centerbrooktechnology.com



Barry Keal

unread,
Mar 17, 2015, 3:36:59 AM3/17/15
to clou...@pignology.net, ba...@keal.me.uk
Hi Charley

Thank you for the extended and helpful response to my queries. The main reason I was looking for some form of api is so that I can, in effect, emulate CloudSync and synchronise between several logbooks including qrz.com. I would use LotW but it seems I need to have a logbook for each location I operate from, bit of a pain when 97% of my operation is mobile, it is the mobile aspect which attracted me to cloud sync in the first place.

What I understand an API (application program interface) to be is a set of standard calls to an application to send, receive and manipulate data by an external application. In my case, it is a link to a local Access (ugh) database used for the Worked All Britain award scheme with HamLog.

One huge problem with HamLog's adif export is that it doesn't export everything in the log. Perhaps it might be easier to do a screen scrape of the log pages and parse that to pull all the info easy enough to to do but it is one way only. Is there any documentation on exportadif.php available? Do you have the format of the cloudsync communications or should I just WireShark the communications and work it out myself?

The use of wget is an interesting thought, I could run that on my web server and then parse in php/Python to my mysql databases. Alternatively I can just plod on with writing my own cloud log which looks after my WAB activity both mobile and fixed for me and the XYL. Plus doing that I would have technical support on hand! 

The support for hamlog seems to be non existent which is a great shame for something I have paid for. Open source/ PD / freeware I can understand there being sporadic support but not for something I'm paying for - another good reason for writing my own which does what I want (eg two different fields adding for wab support)

 Thanks again Charley for your kindness in trying to assist

Regards
Barry

Nick Garner

unread,
Mar 17, 2015, 11:29:31 AM3/17/15
to Barry Keal, CloudLog
Howdy Barry and Charley, 
I'm traveling for business quite a bit these days and the Pignology mailbox is getting a bit busy.

You mentioned:
"One huge problem with HamLog's adif export is that it doesn't export everything in the log."

I wasn't aware this was happening.  Do you mind if I change you password to log into your account and do the export to see what's going on?

Thank you very much Charley for helping out on this one.

Nick

Charley Socci

unread,
Mar 17, 2015, 3:52:05 PM3/17/15
to Nick Garner, Barry Keal, CloudLog

You are both most welcome I hope it was helpful.
Barry try the whether for apiadif.PHP

type: wget <yourlogin>:<yourpassword>@hamlog.it/apiadif.php (this is the same for any OS you might be using) do not include the <> symbols e.g. http://k1dnr:password@hamlot.it/apiadif.php

Now that you can do that, you could put that command into a file called (getmyhamlog.bat) and use Windows Task Scheduler to run it at a particular time everyday -

See last email for detail. I tried it and it worked well.

---------------------

Charley Socci -  www.socci.com

Saxophones, flute and clarinet

860 342 7263 (office)

860 581 3837 (cell)
K1DNR
FN31rn
///////////////////////////////

155 Penfield Hill Road

Portland, CT 06480

Barry Keal

unread,
Mar 17, 2015, 9:06:52 PM3/17/15
to clou...@pignology.net
Hi Nick and Charley,
My bad and huge apologies - it appears that the adi export I was looking at was corrupted, I re did it and this time all what I expected to be there was indeed there. Shows that I should check and check again before engaging the mouth!

Regards

Barry


On Friday, 28 November 2014 10:07:01 UTC, Barry Keal wrote:

Nick Garner

unread,
Mar 17, 2015, 9:39:31 PM3/17/15
to Barry Keal, CloudLog
Hi Barry,
No worries, please send over any further questions/suggestions you may have.  I'll to pay closer attention to my email.

73,
Nick
Reply all
Reply to author
Forward
0 new messages