Re: [bitfolk] usage API

Top Page
Author: Andy Smith
Date:  
To: users
Subject: Re: [bitfolk] usage API

Reply to this message
gpg: Signature made Fri Feb 14 23:31:17 2020 UTC
gpg: using DSA key 2099B64CBF15490B
gpg: Good signature from "Andy Smith <andy@strugglers.net>" [unknown]
gpg: aka "Andrew James Smith <andy@strugglers.net>" [unknown]
gpg: aka "Andy Smith (UKUUG) <andy.smith@ukuug.org>" [unknown]
gpg: aka "Andy Smith (BitFolk Ltd.) <andy@bitfolk.com>" [unknown]
gpg: aka "Andy Smith (Linux User Groups UK) <andy@lug.org.uk>" [unknown]
gpg: aka "Andy Smith (Cernio Technology Cooperative) <andy.smith@cernio.com>" [unknown]
Hi Conrad,

On Fri, Feb 14, 2020 at 09:59:31AM +0000, Conrad Wood wrote:
> is there an API endpoint I can query for current & predicted traffic
> usage?


I'm sorry but no there isn't.

There could be one. I must admit I have never designed an API
before, nor written the backend for one. I'm willing to give it a go
but it might be slow to arrive and the first few iterations
scrapped.

Can you recommend any resources for learning how to do this?

For authentication do I really need to go the whole OAuth 2 route or
can API keys be enough?

Let's assume you have authenticated by whatever method. It's
probably best if that be valid for the whole customer record, so
something like this:

GET https://api.bitfolk.com/v1/guest

…gives you a list of guests. But is that a list of IDs, or a list of
guest names? Let's say it's a list of ID numbers.

GET https://api.bitfolk.com/v1/guest/1234/xfer

gives you back JSON for the current and predicted amounts in and out
for the current accounting period as well as the period start and
end times for guest id 1234?

This is a big project for someone who has never done it before,
unfortunately.

Cheers,
Andy

--
https://bitfolk.com/ -- No-nonsense VPS hosting