Testing the API locally

How to receive device callbacks on a development machine and test REST commands with Postman before you deploy.

Testing Locally (Without Deploying to a Server)

To test your callback integration from your local development machine — without deploying to a production server — you need to make your local machine reachable from the internet so the Cams Protocol Engine can POST callback data to it.

Option A: Public IP + Port Forwarding

If your internet connection has a public (static) IP address, you can forward an external port to your local application.

1

Find your public IP

Visit whatismyip.com or run curl ifconfig.me in your terminal. Note your public IP address.

2

Set up port forwarding on your router

Log in to your router admin panel. Forward an external port (e.g. 8080) to your local machine's internal IP and the port your application is running on (e.g. 3000, 5000, 8080).

3

Configure the Callback URL

In the API Monitor, set your Callback URL to:
http://YOUR_PUBLIC_IP:8080/callback

4

Test

Trigger a punch on the biometric device. The Cams Protocol Engine will POST the callback data to your public IP, which your router forwards to your local application.

Option B: Tunneling Tools (No Public IP Required)

If you don't have a public IP or can't configure port forwarding, use a tunneling service to expose your local server to the internet.

ToolCommandNotes
ngrokngrok http 3000Free tier available. Gives you a public HTTPS URL instantly.
Cloudflare Tunnelcloudflared tunnel --url localhost:3000Free. No account needed for quick tunnels.
localhost.runssh -R 80:localhost:3000 ssh.localhost.runNo installation. Works via SSH.
1

Start your local application

Run your callback server locally (e.g. php -S localhost:8080 or node server.js or python app.py).

2

Start the tunnel

Run the tunneling tool. It will output a public URL like https://abc123.ngrok-free.app.

3

Configure the Callback URL

In the API Monitor, set the Callback URL to the tunnel URL:
https://abc123.ngrok-free.app/callback

4

Test

Trigger a punch. Callbacks will flow through the tunnel to your local machine in real time.

Important: Tunnel URLs are temporary and change each time you restart the tool (unless you use a paid plan with reserved domains). Update the Callback URL in API Monitor each time you get a new tunnel URL.
RESTful API testing does not require this setup. You can call the RESTful endpoint directly from your local machine using Postman or your code — no port forwarding or tunneling needed. Only the Callback API (inbound from Cams to your server) requires your machine to be reachable from the internet.

URL Testing

Before going live, verify your endpoints using Postman. We provide a ready-made collection with all 27 RESTful operations pre-configured.

Postman Collection

Download and import into Postman. Set your base_url, stgid, and auth_token variables — then start testing instantly.

📥 Download Postman Collection
1

Import the collection

Open Postman → Import → drag and drop the downloaded .json file. All 27 RESTful operations appear grouped by category.

2

Set your variables

Go to the collection's Variables tab and set:
base_url = your RESTful endpoint URL (from API Monitor)
stgid = your device's Service Tag ID
auth_token = your device's AuthToken

3

Send requests

Select any operation, edit the JSON body with your values, and hit Send. Verify the response matches the expected format documented above.

Postman Example

Below is a screenshot showing a sample API request configured in Postman. Set the method to POST, paste your RESTful endpoint URL with ?stgid=, and use raw JSON body.

Postman screenshot showing Cams API request configuration
Test your Callback endpoint too. POST a sample RealTimePunchLog JSON (see Op #11) to your Callback URL and verify your server returns {"status":"done"} with HTTP 200.