Jump to content

Marcus Goluch

School User
  • Posts

    64
  • Joined

  • Last visited

Everything posted by Marcus Goluch

  1. Here is one for you, If I wanted to put Frog behind an NGINX reverse proxy what would the config look like?
  2. Thank you That sounds like exactly what I need, just out of curiosity do we have a function that returns the same data as users.getOne but for all users? I am writing up a sync task and the less api calls the better, otherwise I am going to have to do 1 API and 1 MYSQL call per user. Whilst this is the nature of such applications, short cuts are always welcome.
  3. @Graham Quince The category uuid for the MIS data was not easy to locate and I will assume it is a different UUID per server. The idea of the platform I am creating is for it to be used by other schools and thus I need a solution for finding the correct category with out user input. I am not liking the idea of writing an installation manual that says fire up Google chromes networking console and reverse engineer an internal API call. Is there a way for me to look up that uuid for mis data if not can an endpoint for it be added?
  4. Well, what ever you guys have done, I am now getting a response from the API.
  5. Eager to continue on this project, any updates?
  6. Ok, hold onto your hat @Graham Quince because your now heading into one of my rabbit holes. So, firstly I have a function that uses the node js request library to make an API call on the Frog 1 API. This takes an API endpoints url and creates the API request with the oauth headers. const fCallAPI = (sToken, sTokenSecret, sMethod, sURL, oParams = { }, fDone) => { let oConfig = pFrogApi.config.get(); oPrototype.request(`${oConfig.oauth.frogsite}/${sURL}`, { method: sMethod, oauth: { consumer_key: oConfig.oauth.clientid, consumer_secret: oConfig.oauth.clientsecret, token: sToken, token_secret: sTokenSecret }, headers: { "X-AuthType": "oauth_1_0_a" }, qs: oParams, json: true }, (err, req, body) => { if (!fDone) return; if (err || !body) fDone(`Frog API error '${sURL}'`); if (body.status == "error") return fDone(`Frog API error '${sURL}' ` + body.response.message); fDone(null, body.response); } ); }; And this function works perfectly, no issues (example). const fUserByID = (sToken, sTokenSecret, sID, fDone) => { fCallAPI(sToken, sTokenSecret, "GET", "api/fdp/2/user/get", {uuid: sID}, fDone); }; So, now I have a second function to call the Frog 2 API, by creating the request information and passing it to the Frog 1 API function . const fCallAPI2 = (sToken, sTokenSecret, sMethod, sFunction, oParams = { }, fDone) => { fCallAPI(sToken, sTokenSecret, sMethod, "api/2/", Object.assign({ method: sFunction, _v: "2010_0_20", }, oParams), fDone); }; How ever when I call this function I never get a response, instead it just hangs. fCallAPI2(sToken, sTokenSecret, "GET", "users.getDataInCategory", { _device_class: "computer", user_uuid: sUserUUID, uuid: "66851A4F2004C1C988B59F411F928605CB7D97BCEDF3177F" }, (oErr, oResults) => { console.log("ERROR ", oErr); console.log("RESULTS ", oResults); });
  7. I am indeed. I am using the same oauth headers as the api 1 call. Should I start sharing node JS code snippets?
  8. All the 1.0 api calls work fine. I have tried 2 of the 2.0 api calls and they do not work and just hang. I would try more but, I have only dug up how to use: users.getSummary users.getDataInCategory If you have any for me to try I am happy to.
  9. @Graham Quince Can you please verify I am doing this correctly since all the internal API (2) calls just seem to hang and i never get a response. I am trying to query users.getDataInCategory as you sugested. MIS data is located under uuid 66851A4F2004C1C988B59F411F928605CB7D97BCEDF3177F. So, I am sending a GET request to https://<frog-server-address>/api/2/ with the following parameters: method: users.getDataInCategory _device_class: computer user_uuid: <Put student frog uuid here> uuid: 66851A4F2004C1C988B59F411F928605CB7D97BCEDF3177F This means that the request should look this this: https://<frog-server-address>/api/2/?method=users.getDataInCategory&_device_class=computer&user_uuid=EXAMPLE&uuid=66851A4F2004C1C988B59F411F928605CB7D97BCEDF3177F I also have the oAuth 1.0 headers that are working for the external API (1). But yet I get no response and it just hangs, any sugestions?
  10. thanks @Graham Quince So, I can use the endpoint for the category API. What is the best way of getting the info on the internal API end points and parameters? Otherwise I'll be browsing though obscured frogOS java script clientside code looking for them for days. Frog's user front end is exceptionally complex
  11. Hi Graham, Is there an API endpoint for users.getDataInCatagaory because I am using the external API. Also Balances is this thing here
  12. @Graham Quince This one I think will need a dev to look at. Can i use /api/fdp/2/user/get to get a students enrolment number. At the moment it does not seem the API provides that. I am working on a user end extractor/importer for frog. This would allow server admins to import data from services like Bio-Store into our custom widgets.
  13. Its working..... I now have ULIMITED POWA! ? Now my only question is how far should I got with this application? Thanks for the help Graham. What are balances? & Would this be a better way to do Catering Balance instead of frog data store?
  14. Thank Graham, Will try this when tonight. Oh this is getting exciting.
  15. So, I have finally found time to sit down and start playing with this. I now have oath working so I can sign in and obtain a token and secret from my log in. Anyway I am stuck trying to figure out how to authorize requests on the api. Just keep getting 401 No auth type given I have all the correct oauth 1.0 headers, any suggestions? { "status": "error", "response": { "message": "No auth type given", "code": "auth-failed", "http": 401 }, "request": { "url": "/auth/get", "method": "get", "headers": { "host": "<REDACTED>", "authorization": "OAuth oauth_consumer_key=\"<REDACTED>\",oauth_nonce=\"<REDACTED>\",oauth_signature_method=\"HMAC-SHA1\",oauth_timestamp=\"1616357044\",oauth_token=\"<REDACTED>\",oauth_version=\"1.0\",oauth_signature=\"<REDACTED>\"", "connection": "close" }, "params": [] } } Maybe @Graham Quincecould get one of the devs to check out it works back end?
  16. I sent it via the Forums direct message system.
  17. I have forwarded you a little something.
  18. @mhamilton I am working on something with ADFS that I recently showed Graham. It would allow seamless teams and streams integration. It could easily be adapted for Azure SSO. If you like, I can throw you a copy of the documentation I wrote, get some feedback from another frog admin.
  19. I have just been advised by the support team, that getting oAuth access is not possible. This is not because it does not work, but because there is no documentation. Despite the fact documentation is available on the frog box. The only thing thing I can see missing in that documentation is the API request headers for bearer and clientID. Though not much documentation would be required for this API since oAuth is already heavily documented standardised protocol and this form of API is always very similar. @simon brahancould you please clarify.
  20. Thank you again Simon. I have now confused your support team with this request, but I have faith in them ? I think I will let you in on my plans, maybe you will have input on this project idea. My plan is to create a new server running a Bio-Store extractor and a my little node js webservice. Every hour, the Bio-Store extractor will pipe out a csv of Bio-Store balances, this csv is then ingested by my node app. The API is then used to set a value in the data store for each user. That value can then be displayed later using a custom widget. ? I often export all the student data from frog and use a node to perform csv magic for user account management tasks. I think generally this could be come some sort of tool for scheduling custom imports and exports from the frog data store. Any suggestions, ideas, concerns, criticisms welcome.
  21. Thanks Graham, Sadly this is not working as I do not see such an option when i have a project selected.
  22. Excellent. Is it just a support ticket to turn this on?
  23. Hi all, I know this is on the back burner, but i thought i would compile a list of issues that I feel the frog code editor needs addressing. Users can not delete a project in frog code once created. This leaves a huge mess of abandoned projects. Deleting or creating a new file will collapse the entire directory tree, this is extremely frustrating. The Code console assumes that a string value will be returned. If you return a number you will be given an error from toString(). If you run a line that provides no return value then it will still attempt to cast that null to string causing an error. Malformed Javascript errors do not provide any context or trace details to help debug the cause. Altering certain ejs templates will completely break a project with out giving an error. Even after returning to default code the widget will still be broken.
  24. Morning @simon brahan So looking into this further, can i use the API with out using oAuth. Say, I wanted to dump a datastore value for every student into a csv from a node js script at 12am every morning. So that another service can consume that csv and do what ever with it. Otherwise to use oAuth means the user would need to log in first though a web client, its not that much of a problem just extra work. But yes, I would love to have a play with oAuth if we can set that up. Are there any limits to the API and what impact would its use have on the frog box if any impact at all. In regards to the SQL access, I would simply use a separate sql server. Using the one on the frog box would not be something that would work well long term for 3rd party databases.
  25. @simon brahan Hi Simon, I think i have had a bit of a mad idea. After noticing frog supports oAuth1.0 (can we get 2.0?) with a back end api. Could I read from / write to, the datastore store from say a node js application. I could do, some extremely interesting things if the answer is yes. Secondly, @Graham Quince I would be very interested to take a second look at your project, because i may have a use for it. Thank you both, for taking time.
×
×
  • Create New...