magicbug / Cloudlog

Web based amateur radio logging application built using PHP & MySQL supports general station logging tasks from HF to Microwave with supporting applications to support CAT control.
http://www.cloudlog.co.uk
MIT License
450 stars 189 forks source link

API for adding QSOs #293

Closed M0LTE closed 5 years ago

M0LTE commented 5 years ago

Is your feature request related to a problem? Please describe. There doesn't seem to be an API for pushing in QSOs from external programs

Describe the solution you'd like I would like to be able to POST some JSON a bit like this to https://my-cloudlog/index.php/api/qso (with API key)

{
  "time": "2019-06-15T22:06.05Z",
  "freq": 10136750,
  "mode": "FT8",
  "theircall":"2E1EPQ",
  "theirgrid": "JN02",
  "recvrpt": "-10",
  "sentrpt": "+04",
  "mygrid": "IO91lk",
  "operator": "M0LTE"
}

I plan to write a tool to watch wsjtx_log.adi and post to that API to enable auto-logging - though the same mechanism could be used by other tools.

Describe alternatives you've considered There isn't really an alternative

Additional context n/a

magicbug commented 5 years ago

Yes, something I'm currently adding per a request from M1BXF & M0VFC I was going to just do it so you could submit ADIF string, but I can do it so it supports both.

M0LTE commented 5 years ago

Either is good :)

Started hacking something around last night but figured you’d probably want to handle something so core yourself, so I stopped.

Cheers Tom

On Sun, 16 Jun 2019 at 12:29, Peter Goodhall notifications@github.com wrote:

Yes, something I'm currently adding per a request from M1BXF & M0VFC I was going to just do it so you could submit ADIF string, but I can do it so it supports both.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/magicbug/Cloudlog/issues/293?email_source=notifications&email_token=AJAQNWDRGACOITWMZJXHDLDP2YPZJA5CNFSM4HYP6MU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXZK5TQ#issuecomment-502443726, or mute the thread https://github.com/notifications/unsubscribe-auth/AJAQNWF7HRNBV6Q6G2B66VLP2YPZJANCNFSM4HYP6MUQ .

magicbug commented 5 years ago

If you fancy adding a json function for QSO then feel free Tom, not touched it yet.

magicbug commented 5 years ago

Hi Tom,

It is now possible to do it with json post to the following URL /index.php/api/qso

Example

{"key":"YOUR_API_KEY", "type":"adif", "string":"<call:5>N9EAT<band:4>70cm<mode:3>SSB<freq:10>432.166976<qso_date:8>20190616<time_on:6>170600<time_off:6>170600<rst_rcvd:2>59<rst_sent:2>55<qsl_rcvd:1>N<qsl_sent:1>N<country:24>United States Of America<gridsquare:4>EN42<sat_mode:3>U/V<sat_name:4>AO-7<prop_mode:3>SAT<name:5>Marty<eor>" }

It can actually handle multiple lines, I do need to add some error handing notifications but it does work.

M0LTE commented 5 years ago

Good stuff Peter :) ADIF inside JSON ;-) works for my needs.

Is that example the complete set of ADIF fields supported? If I send more will they be correctly silently ignored? Or do I need to clean up lines before sending them in?

Have you made use of HTTP status codes for success/failure?

Cheers Tom

On Mon, 17 Jun 2019 at 15:13, Peter Goodhall notifications@github.com wrote:

Hi Tom,

It is now possible to do it with json post to the following URL /index.php/api/qso

Example

{"key":"YOUR_API_KEY", "type":"adif", "string":"N9EAT70cmSSB432.166976201906161706001706005955NNUnited States Of AmericaEN42U/VAO-7SATMarty" }

It can actually handle multiple lines, I do need to add some error handing notifications but it does work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/magicbug/Cloudlog/issues/293?email_source=notifications&email_token=AJAQNWB7IT6XQMSQOPV3L6TP26LYDA5CNFSM4HYP6MU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX3JPGI#issuecomment-502699929, or mute the thread https://github.com/notifications/unsubscribe-auth/AJAQNWD6PCN522D4O3F3RADP26LYDANCNFSM4HYP6MUQ .

magicbug commented 5 years ago

It supports all ADIF fields, if you have them Cloudlog will chew all the data into the table.

Its a complete bodge at the moment, I will go back to it and add proper error handling, I'll also add the ability to send QSOs as per your request rather than just ADIF this just meets the need of a few requests I've had.

M0LTE commented 5 years ago

Look forward to trying it.

Cheers Peter.

On Mon, 17 Jun 2019 at 15:19, Peter Goodhall notifications@github.com wrote:

It supports all ADIF fields, if you have them Cloudlog will chew all the data into the table.

Its a complete bodge at the moment, I will go back to it and add proper error handling, I'll also add the ability to send QSOs as per your request rather than just ADIF this just meets the need of a few requests I've had.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/magicbug/Cloudlog/issues/293?email_source=notifications&email_token=AJAQNWHRIVMA2YNDQ2UHTGTP26MOHA5CNFSM4HYP6MU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX3KCUA#issuecomment-502702416, or mute the thread https://github.com/notifications/unsubscribe-auth/AJAQNWAPFVESZGIWZRHDMOTP26MOHANCNFSM4HYP6MUQ .

magicbug commented 5 years ago

401 for failed due to api 201 if records created successfully

are currently set

magicbug commented 5 years ago

Now just need someone to build an app that can monitor local folders for ADIF files and send qsos to Cloudlog automatically saving uploading! :)

M0LTE commented 5 years ago

I’m on it!!

On Mon, 17 Jun 2019 at 15:47, Peter Goodhall notifications@github.com wrote:

Now just need someone to build an app that can monitor local folders for ADIF files and send qsos to Cloudlog automatically saving uploading! :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/magicbug/Cloudlog/issues/293?email_source=notifications&email_token=AJAQNWCJC55O37MENAVRXQDP26PWRA5CNFSM4HYP6MU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX3M6XQ#issuecomment-502714206, or mute the thread https://github.com/notifications/unsubscribe-auth/AJAQNWASE74ZIYXKTSWGBNDP26PWRANCNFSM4HYP6MUQ .

magicbug commented 5 years ago

Fab, means I dont have to subject anyone to my terrible c# 👍