Jump to content

dhicks

Members
  • Posts

    8,098
  • Joined

  • Last visited

Reputation

14,554 Excellent

About dhicks

Personal Information

  • Location
    Knightsbridge
  • Homepage
    http://www.sansay.co.uk

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. This isn't something I'm going to be able to install and test myself, but it certainly looks like an interesting project. Is this currently Windows / Microsoft only - does the software only work on a Windows server, do you only support Microsoft 365 logins? For authentication, would you support authentication by trusted proxy header, allowing for user details to be passed in by an up-stream HTTPS proxy that handles user authentication - something like Cloudflare Tunnels or Tailscale, or Pangolin for a self-hosted solution?
  2. Last-minute booking yesterday for train and hotel - looks like I might be in Derby by about 5pm (unless I don't make the window for my super off-peak train ticket, in which case I'll be nearer 9pm). Are people meeting up somewhere this evening?
  3. I've not yet tried getting a n AI coding assistant to write anything that controls physical hardware, although it sounds like it would make for an interesting exercise. I do currently have a USB DMX interface not being used, which could do with a nice touch-screen user interface for lighting control, that might make a good first project. It might be a good idea to be careful as to exactly what hardware you are hooking up to AI-written code - for some reason I'm picturing a mini PC on a motorised wheeled base with a webcam and a circular saw from a sawbench...
  4. This Python IDE works in a similar manner: https://milesberry.net/pyde/ Or this version (features added to the original): https://ukfootprint.github.io/pydeXTD/ That might well be the perfect solution for anyone looking for a Python code editor usable for lessons and exams - works entirely in the browser, can be used offline, and you can host on your own website if you have any privacy / filtering concerns. I know both Miles (the original author) and Simon (the author of the extended version), and both have a lot of experience in school environments, so this is something designed with practical usage in actual (UK) schools in mind.
  5. We have a bunch of batch-processing scripts (import new users, that sort of thing) run at about 3am. It still couldn't get to the iSAMS Batch API at 3am this morning. I've now added new code to failover to the REST API instead, which seems to work okay.
  6. Ah - but I don't currently seem to be able to get data from the iSAMS Batch API.
  7. That's the thing - I don't remember seeing any email directly from iSAMS, or it simply passed me by. I did see an email fom Wonde last week saying there would be a "first brownout" for the old-style keys, which is what I've assumed is happening today.
  8. As an added bonus: iSAMS are changing the way their Batch API is implemented, moving to a (more common) dual "ClientID" and "ClientSecret" values rather than a single "API Key" value. Today (as we're preparing reports for the first time with the new school portal and wanting to be able to write a script that sorts out the reports for us) is the day that the changeover occurs, hence I now need to go back and re-implement how the Batch API call works.
  9. I suspect that means you need to upgrade your iSAMS subscription to a version where REST API keys are a thing, otherwise possibly the person you were talking with didn't understand what you were asking for. On our instance of iSAMS we can simply add REST API keys ourselves from the Control Panel. If you already sync your data from iSAMS to Wonde you could maybe look at Wonde's API instead - I've foundthem very helpful inthe past, they have a whole proper developer relations department for dealing with this kind of thing.
  10. Ah - you mean for visitor / guest access? We have much the same issue - we want to be able to match the exact person using a voucher to that actual person. At the moment, the plan is to get voucher codes via the UniFi API and produce a printable sheet that the front desk staff can manually hand out. I was thinking of having a touch-screen all-in-one PC on the front desk, complete with camera, that could take a picture of the user as they were assigned a voucher code, but that seemed slightly like an over-the-top sort of solution for the size of the problem in our case.
  11. The Python code is, hopefully, fairly generic - a little clunky / step-by-step in the way it does things, but hopefully that makes it easier to read through if you don't generally use Python. This is the kind of thing an AI coding assistant can be very good at helping with - you can probably just copy-and-paste the above into any chatbot asistant and ask it to re-write in the language of your choice. Is "Socs" a section / module in iSAMS? You could, potentially, write medical information back to iSAMS if that is coming from a separate system somewhere. If you're writing pupil records via the iSAMS REST API, be aware that the API writes blank values - if you define a record, write the value you want to a particular field but leave the rest of the fields blank, the API will happily overwrite those blank values to the database. You need to do a GET request first, populate the record with any existing values, make any additions / changes, then do a POST to write back to iSAMS. If the data the staff require is static (I'm guessing a list-of-medical-conditions per child per club / society), I find generating a viewable / printable PDF works quite nicely - you can have a script go through the data, match up pupils with any medical conditions and produce a formatted PDF you can then upload to OneDrive / Googel Drive / etc. Again, the sort of thing (with suitible safeguards for data handling) an AI assistant can pretty much write for you in a few minutes now.
  12. I have secrets (REST API keys, etc, that you get from the iSAMS Control Panel) in a simple JSON file, loadable by a script: # Load the configuration file. config = json.loads(dataLib.readFile("config/config.json")) for requiredConfigParameter in requiredConfigParameters: if not requiredConfigParameter in config.keys(): print("Error - required value " + requiredConfigParameter + " not set in config.json.") sys.exit(1) Something like: { "iSAMSAPIDomain":"exampleschool.isams.cloud", "iSAMSRESTAPIID":"12345678-1234-1234-1234-123456789012", "iSAMSRESTAPISecret":"12345678-1234-1234-1234-123456789012", } Then a couple of functions to call the REST API: # Retrive the cached iSAMS REST API Access Token, or request a new one if needed. def authenticateWithiSAMSRESTAPI(): if os.path.exists("accessToken.txt"): access_token = dataLib.readFile("accessToken.txt").strip() else: print("Authenticating with iSAMSREST API...", flush=True) requestURL = "https://" + config["iSAMSAPIDomain"] + "/auth/connect/token" response = requests.post(requestURL, data={"client_id":config["iSAMSRESTAPIID"],"client_secret":config["iSAMSRESTAPISecret"],"grant_type":"client_credentials","scope":"restapi"}) if not response.status_code == 200: print("Error athenticating with the iSAMS API:") print("URL: " + requestURL) print("Error Code: " + str(response.status_code)) print("Data: " + str(response.content)) sys.exit(1) access_token = json.loads(response.content.decode("utf8"))["access_token"] dataLib.writeFile("accessToken.txt", access_token) return access_token iSAMSAccessToken = authenticateWithiSAMSRESTAPI() # A handy function to do a call to the iSAMS REST API. Uses the global "iSAMSAccessToken" value for authentication - if that access token fails (default expiration is after 1 hour), # it gets a fresh access token and tries again. Only does 2 tries to avoid getting stuck in a loop. def iSAMSRESTAPICall(theMethod, theEndpoint, theData): global iSAMSAccessToken tries = 0 while tries < 2: tries = tries + 1 print("Doing " + theMethod + " to " + theEndpoint + " with data:", flush=True) print(str(theData).encode("utf-8"), flush=True) requestURL = "https://" + config["iSAMSAPIDomain"] + theEndpoint requestHeaders = {"accept":"application/json","authorization":"Bearer " + iSAMSAccessToken, "content-type":"application/json"} if theMethod == "get": response = requests.get(requestURL, data=json.dumps(theData), headers=requestHeaders) elif theMethod == "put": response = requests.put(requestURL, data=json.dumps(theData), headers=requestHeaders) elif theMethod == "patch": response = requests.patch(requestURL, data=json.dumps(theData), headers=requestHeaders) else: print("iSAMSRESTAPICall: Unknown request method: " + theMethod) if response.status_code == 200: return response elif response.status_code == 401 and tries < 2: print("iSAMSRESTAPICall: iSAMS authentication access token expired - retrying.") os.remove("accessToken.txt") iSAMSAccessToken = authenticateWithiSAMSRESTAPI() else: return response Then you can do calls to the REST API: getResponse = iSAMSRESTAPICall("get", "/Main/api/students/" + SchoolId, {}) if getResponse.status_code == 200: pupilData = json.loads(getResponse.text)
  13. This is the kind of thing where AI assistance can work really well, both in explaining how-it-works to you and, if you have a suitible coding agent, writing the code for you. If I remember correctly, iSAMS uses an OpenAPI/Swagger REST API interface - you might have seen other services offer the same thing, where you get a handy documentation and live try-it-out box all in one. You are basically doing HTTP(S) calls to a given endpoint, with defined parameters - the Swagger UI willl let you try out values and show you the URL strings (and even examples in Javascript / Python / etc) as you type. You authenticate via OAuth - I can't remember setting up a REST API with iSAMS, I suspect it was a while ago and I probably had to do a log-in-with-Google step in the browser the first time.
  14. There's a couple of "photos for work" apps that allow you, as an admin, to define where photos taken get synced to. Instead of the user taking a photo and then manually sharing to a location (e.g. somewhere on Googel Drive, for which they need to be logged in with their Google account, etc), the app simply takes the photo and uploads it to a defined cloud / network share. This saves a bunch of messing around, you could have a school-owned mobile device with a big sticker on the back ("Photos Phone 1") with the phoos app set as a kiosk (so it only does photos), any photo taken gets uploaded to a cloud-based folder that staff (maybe pupils) can access.
  15. VeryPC have some rather snazzy laptop stands with integrated USB-C connected docking ports which might be worth looking at.
×
×
  • Create New...