-
Notifications
You must be signed in to change notification settings - Fork 0
Custom authorization form
If you wish to integrate ShelterZoom into your own system you will need to incorporate custom authorization form inside your system's admin console.
Your custom form will need to authorize using SDK Firebase for js.
Use the following parameters to connect to ShelterZoom Property DataBase:
<script src="https://www.gstatic.com/firebasejs/4.8.1/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyCwNcgMsAJV-uKlqOJ1QuqLwhRBdaFIQGk",
authDomain: "shelterzoom.firebaseapp.com",
databaseURL: "https://shelterzoom.firebaseio.com",
projectId: "shelterzoom",
storageBucket: "shelterzoom.appspot.com",
messagingSenderId: "890385557670"
};
firebase.initializeApp(config);
</script>Following the successful initialization you will need to authorize using firebase.auth().signInWithEmailAndPassword(email, password).
More info about Firebase authorization could be found here
- Getting API key
After succesfull authorization you will need an idToken.
idToken. firebase.auth().currentUser.getIdToken(true)
https://firebase.google.com/docs/auth/admin/verify-id-tokens
Then call ShelterZoom Database
-
URL
https://us-central1-shelterzoom.cloudfunctions.net/api/widgetInfo -
Type
GET -
Auth
Bearer via header. Example : Authorization : bearer IdToken // Received earlier -
Success Response:
-
Code: 200
Content:{ "accessAPIToken": "a10dd8d6-5cfd-47fa-83fd-00b1d2a34123" }
-
Code: 200
-
Error Response:
-
Code: 500
Content:{ error : "description" }
-
Code: 500
The key should be used in order to submit properties into ShelterZoom Databases