Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Overview
  • FAQs
  • Software Guides
  • Hardware Guide
  • Integration
  • Technical Blogs

Categories

  • Overview
  • FAQs
  • Software Guides
  • Hardware Guide
  • Integration
  • Technical Blogs
Home / Integration / Spintly Platform Integrations

Examples of how to use type 2 with your application

Categories

Overview FAQs Software Guides Hardware Guide Integration Technical Blogs

Examples of how to use type 2 with your application

Example 1:

 

CREATING USERS

Say suppose you have your own website which solves certain problems of your user, the website might look something like this

 

And using this website you can add different users to it who could access the website

 

 

Now when you add the user, you might have a database in the cloud which might be looking something like this

Locations table

id name
1 Mumbai
2 Dubai
3 New York

Roles table

id name
1 Admin
2 EndUser

Users table

id name email roleId locationId
1 JaneDoe janedoe@example.com 1 1
2 johnDoe johndoe@example.com 2 2

 

Now if you want the users who are there in your system to use spintly application also, you could go with the following two approach

  1. Manullay add users in your website and spintly website
  2. Use Spintly CRUD apis to add users in spintly

1st approach would have made sense if you had one users, imaging daily you have to use add 1000 users, the first method is ineffective

Thats why the website needs use spintly apis to create users in spintly, without the admin going to the spintly dashboard,

Below are the changes which you will have to do in your backend

Locations table

id name spintlySiteId
1 Mumbai 1001
2 Dubai 1002
3 New York 1003

Roles table

id name spintlyRoleId
Admin 1 20
EndUser 2 21

Users table

id name uniqueId email roleId locationId spintlyOrgUserId
             
             

 

Doors table(Will have to create to store accesss points)
(Here SpintlyAccessPointId can be populated by providing spintly a webhook, whenever a new door is added, the same door details can be forwarded to yourbackend and you map it to your door)

id locationid name spintlyAccessPointId
1 1 Door 1 23
2 2 Door 2 34
3 3 Door 3 44
4 4 Door 4 45

 

So now whenever a user is added from the website as show below

 

 

You will first have to create the user in your backend first

Users Table

id name uniqueId email roleId locationId spintlyOrgUserId
1 john doe #12333 johndoe@example.com 1 3  
             

 

Once the user is created in your backend, you will have to call spintly Create user api mention in the , the one which is marked in green is the information which is collected from you backend and sent to spintly, as seen above the uniqueId you can take it from your users table and put it for the uniqueId value in spintly's create user api, based on the location selected you can give access point ids(this can be found in the doorIds table), for homesiteid value you will have to put the spintlySiteId value from location table(above)

 

 

Once the user is created in Spintly, it will return a orguserId, which  you need to map it to your user in users table as shown below

Users table

id name uniqueId email roleId locationId spintlyOrgUserId
1 john doe #12333 johndoe@example.com 1 3 650126
             

 

the same user you can see in spintly website also

 

The user can then login to the sample app which spintly has provided (please refer to steps to get up and running(Type 2) on how to use the mobile app)

 

 

DELETING USERS

Deleting users in spintly is almost similar to how you created the user, say you want to delete the user john doe as show below

 

 

When you get a delete request make sure you first delete the user in spintly, and then delete the user in you backend, when deleting user in spintly you will have to use the spintly orguserid which you got while creating the user

Users table

id name email roleId locationId spintlyOrgUserId
1 john doe johndoe@example.com 1 3 650126
           

 

Below is the api  how it will look, once you delete, spintly will return a success  and once you get success you can delete the user from your backend

 

 

Users table

id name email roleId locationId spintlyOrgUserId
           
           

 

utilize implement

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Examples of how to use type 1 with your application
  • Transforming Smart Buildings With Wireless Mesh Technology: A Comprehensive White Paper On Spintly's Access Control Solutions
  • The Role of NFC and Bluetooth in Modern Security
Spintly

Industries

  • Multifamily / Residential
  • Co-Working
  • Education
  • Healthcare
  • Hospitality
  • Manufacturing
  • Fitness & Wellness

Solutions

  • Access Control
  • Visitor Management
  • Tenant Management
  • Time & Attendance Management

About

  • About Us
  • Partners
  • FAQ
  • Privacy Policy
  • Terms & Conditions

Resources

  • Case Studies
  • Blogs
  • Whitepapers
  • Webinars
  • Press
  • Data Sheets

Contact Us

  • Sales: sales@spintly.com
  • Tech Support: support@spintly.com
  • Get a Quote
© 2024 Spintly. All Rights Reserved. | 691 S Milpitas Blvd, Ste 217 Milpitas, CA 95035
Expand