Documentation concerning code and connections between the Raspberry Pi server and the Nexudus server/database. This documentation should include notes on Nexudus' API and how to map our MakerSphere vocabulary (e.g. student, machine, class) to Nexudus' vocabulary and object structure.
(Last Updated 3/27/2018 by Sunshine)
(Last Updated 3/29/2018 by Lishan)
export some data sample like user, Resource and Resource type, we should be need some of items from those data like Sunshine share the API endpoints we need.
https://docs.google.com/spreadsheets/d/11PUpA2faEFaFxx-nqjjiuQUpXLwtSkYJjoE51AGtQoA/edit?usp=sharing
https://docs.google.com/spreadsheets/d/1lbGT-1J93b_iEF6b9Y1vGR7HGFsJt-vGAikUHk7xNRc/edit?usp=sharing
https://docs.google.com/spreadsheets/d/1SrPRz_R7BBgr_QTs5O3QHKa7egswqM23ci4LChb7F1w/edit?usp=sharing
(Last Updated 3/30/2018 by Lishan)
A sample script to connect to Nexudus server and get username
https://docs.google.com/document/d/128lD7i31HBZ7WCCOhTDa0gqps0boZSPE0pCJMtgInJg/edit?usp=sharing
(Last Updated 3/29/2018 by Lishan)
Revised the Machine Categorization and summary of the Pi to Nexudus Processdure
Machine Categorization_new
https://docs.google.com/document/d/1TMDzZs0_7LcacCLXbd-z9bymKpv00mDcPEulT_TKKEU/edit?usp=sharing
Nexudus_Guide
https://docs.google.com/document/d/1H24zofl3YRWs0x-6CNzBVxvuEREgNgWMjtl5XU5O12I/edit?usp=sharing
(Last Updated 4/18/2018 by Sunshine)
https://spaces.nexudus.com/api/spaces/resources
https://spaces.nexudus.com/api/spaces/resources/{id}
https://spaces.nexudus.com/api/spaces/resourcestypes
https://spaces.nexudus.com/api/spaces/resources/{id}
https://spaces.nexudus.com/api/spaces/resourceaccessrules
https://spaces.nexudus.com/api/sys/users
https://spaces.nexudus.com/api/sys/users/{id}
https://spaces.nexudus.com/api/sys/users/token
https://spaces.nexudus.com/api/sys/users/{id}/token/refresh
https://spaces.nexudus.com/api/spaces/bookings
https://spaces.nexudus.com/api/spaces/bookings/{id}
GET https://spaces.nexudus.com/api/spaces/bookings?Booking_Id=123456 returns record with that id
https://spaces.nexudus.com/api/spaces/checkins
https://spaces.nexudus.com/api/spaces/checkins/{id}
https://ccsf.spaces.nexudus.com/api/public/checkin
https://spaces.nexudus.com/api/spaces/accesstokens
https://spaces.nexudus.com/api/spaces/accesstokens/{id}
(Last Updated 3/27/2018 by Sunshine)
Below contains documentation on which of the main keys in Nexudus API records should be called in order to access their data using python.
(Last Updated 4/4/2018 by Sunshine)
To create custom fields in an user object, you can pass extra properties on top of the required properties from the API. So if we were to do it through the python script it would be done by passing extra parameters through requests in order to have custom fields. This can be done during the initial creation of the user object when we pass the name, email, and other things that the API requires. To do this you need to use the endpoint: https://spaces.nexudus.com/api/sys/users
The required properties that need to be passed in the request body to create a user are:
//Add or remove businesses
//Add or remove userroles
//Add or remove chatrooms
On top of those you can add additional properties of your choice according to the API documentation. Not sure if the custom fields can be accessed and updated through the update method but they should.
So for example, if you pass a custom field called "isStudent" with the value true, that info would be stored with that user and will display when you want to access it.
In order to access those custom fields, you would have to use the "GET single" end point:
https://spaces.nexudus.com/api/sys/users/{id}
This end point would get the user with that id and its info along with the custom fields.
(Last Updated 4/18/2018 by Sunshine)
There is a tab in in spaces.nexudus.com in spaces -> resources -> {resource name} details -> access rules where you can set which user has access to that particular resource. You can assign access individually or to a group of users.
I could not find any api documentation on the endpoint: https://spaces.nexudus.com/api/spaces/resourceaccessrules
However, that endpoint works in the python code that Lishan wrote for it. I believe that endpoint returns a dictionary of access rule ids and member info for all resources and https://spaces.nexudus.com/api/spaces/resourceaccessrules/{id} returns user ids who can access that resource id.
When making reservations and checkins, we will have to convert the times and make sure they are in UTC format as Nexudus API uses UTC.
(Last Updated 4/24/2018 by Lishan
using python code to connect to Nexudus API and get the user data, machine data and booking data to check if the user exist in the server, if the user have access rights to the resource, and if the user have reservation about the resource. with those data we create user class, machine class and booking class . we also provided test data about below and the workflow
https://drive.google.com/file/d/1zeSeaFAGR6axJWljPvOlRDRjZpG5xFta/view?usp=sharing