Feature Overview

This guide walks you through logging into the system using the Developer Portal APIs. Whether you're new to programming or APIs, this step-by-step tutorial will help you navigate the process smoothly.

Step 1: Access the Developer Portal

  1. Open your browser and go to: https://developers.airfobspace.com/login.
  2. Click Sign Up on the front page.
  3. Fill out the sign-up form and submit it. Your request will be sent to Moca System for approval.
  4. Once approved, log in using your new credentials.

Step 2: Access the API Documentation

  1. After logging into the Developer Portal, navigate to API → Document.
  2. Here you will find detailed API documentation.

Step 3: Create a Demo Site and Get an API Key

  1. Go to API → Management.
  2. Click the + Register button to create a new application.
  3. Select Demo as the Application Type.
  4. Enter an Application Name of your choice and click Register.
  5. A Successful Registration popup will appear. Click Download to get an Excel file containing your email and password.
  6. Click on your newly created application and select API Management.
  7. In the Issuing API Key popup, enter a name for your API key and click OK to generate it.

Step 4: Log Into the Demo Portal

  1. Return to the home menu.
  2. Click Demo Portal from the left-side menu.
  3. Log in using the email and password from the Excel file.
  4. Enter the API Key you just created.
  5. You are now logged into the system!

Step 5: Optional - Login via Postman (3-Step Process)

Step 1: Login API Call

Endpoint: Login

Request Body (JSON):

{
  "username": "your_email",
  "password": "your_password"
}
    

If successful, you will receive a JWT token. Use this token as the Bearer Token in all following API calls.

Step 2: Get Self Accounts

Endpoint: getSelfAccounts

Authorization: Bearer Token (JWT from Step 1)

This call will return the list of available sites/accounts you can access.

Step 3: Login to an Account

Endpoint: loginAccount()

Use your Bearer Token in this call as well.

Step 6: How to Get the Bearer Token on Windows & Mac Browsers

For Windows - Microsoft Edge or Google Chrome

  1. Press F12 (or Ctrl + Shift + I) to open Developer Tools, or right-click and select Inspect.
  2. Click on the Network tab.
  3. Reload the page to capture network activity.
  4. Use the search bar to filter API calls, e.g., search for groups or login.
  5. Click on the desired API request to open its details.
  6. Go to the Headers tab and scroll to Request Headers.
  7. Find the line starting with Authorization: Bearer.
  8. Right-click the token and select Copy value.

For Mac - Google Chrome or Microsoft Edge

  1. Press Command (⌘) + Option + I or right-click and select Inspect.
  2. Click on the Network tab.
  3. Reload the page if needed.
  4. Filter for API calls using keywords like groups.
  5. Click on an API request, then go to the Headers section.
  6. Find Authorization: Bearer and copy the token.

For Safari on Mac

  1. Enable Developer Tools if not already enabled: Safari → Preferences → Advanced → Check Show Develop menu in menu bar.
  2. Press Command (⌘) + Option + I or select Develop → Show Web Inspector.
  3. Click on the Network tab.
  4. Reload the page.
  5. Search for API calls like groups.
  6. Click on a request and go to the Headers tab.
  7. Find Authorization: Bearer under Request Headers and copy the token.

Step 7: Use User-Related APIs

Once logged in, you can now perform user management actions such as:

  • getUsers
  • createUser
  • updateUser
  • suspendUsers

Always include the Bearer Token in the Authorization Header.

Demo Environment vs. Production Environment

The above steps are for the Demo environment. For Production:

  • Create sites via the Partner Portal.
  • Use APIs as long as you know the site ID, email, and password for production.

Important Notes

  • To activate a user, at least one credential type (e.g., RF Card, Mobile, Linkpass) must be enabled.
  • User IDs and Account IDs are different. Do not mix them up.
  • Keep track of passwords if you are switching between different sites.
  • The Bearer Token must be updated and used consistently across all API calls.
  • You can use the same Bearer Token in Postman if retrieved from the Site Portal first.