Overview

The Netstat JSON API allows approved clients, applications, and automation systems to submit contact or support requests directly to our backend. All submissions are securely stored in our database and processed by our team.

Endpoints

POST https://netstat.com.au/auth.php          → Obtain JWT access + refresh tokens
POST https://netstat.com.au/auth_refresh.php  → Refresh an expired access token
POST https://netstat.com.au/contact_api.php   → Submit a contact/support request
    

Authentication

The API uses a two‑step authentication process combining API keys and short‑lived JWT access tokens.

Step 1 — Obtain a JWT Access Token

Send your API key to the authentication endpoint:

POST /auth.php
Header: X-API-KEY: XXX-XXX-XXX
    

Successful responses return:

{
  "access_token": "",
  "expires_in": 900,
  "refresh_token": ""
}

Step 2 — Use the JWT to Call the API

All API calls must include the JWT access token:

Authorization: Bearer <jwt>
Content-Type: application/json
    

Requests without a valid JWT will be rejected with 401 Unauthorized.

Token Refresh

Access tokens expire after 15 minutes. Use your refresh token to obtain a new access token:

POST /auth_refresh.php
{
  "refresh_token": ""
}
    

Request Body

The API accepts the following JSON fields:

Example JSON

{
  "name": "John Smith",
  "email": "john@example.com",
  "phone": "0400 000 000",
  "business": "ABC Pty Ltd",
  "message": "We need help with our server."
}

Example Requests

PowerShell — Obtain JWT

curl -Method POST `
     -Headers @{ "X-API-KEY" = "XXX-XXX-XXX" } `
     https://netstat.com.au/auth.php
    

PowerShell — Submit Contact Request

$jwt = ""

$body = @{
    name    = "PowerShell Test"
    email   = "test@example.com"
    message = "Testing API"
} | ConvertTo-Json

Invoke-RestMethod -Uri "https://netstat.com.au/contact_api.php" `
    -Method POST `
    -Headers @{ "Authorization" = "Bearer $jwt" } `
    -ContentType "application/json" `
    -Body $body
    

cURL (Windows CMD)

curl -X POST https://netstat.com.au/contact_api.php ^
-H "Content-Type: application/json" ^
-H "Authorization: Bearer " ^
-d "{\"name\":\"CMD Test\",\"email\":\"cmd@example.com\",\"message\":\"Testing JSON API\"}"
    

JavaScript (AJAX)

fetch("/contact_api.php", {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "Authorization": "Bearer "
    },
    body: JSON.stringify({
        name: "Web App",
        email: "web@example.com",
        message: "Testing API"
    })
})
.then(r => r.json())
.then(console.log);
    

Response Format

Successful responses return:

{
  "status": "success",
  "message": "Submission received",
  "id": "123"
}

Error responses include:

{
  "status": "error",
  "message": "Missing field: name"
}

Rate Limiting

Each API key has its own rate limit configuration. Excessive or abusive requests may be temporarily blocked with 429 Too Many Requests.

Security Features

Support

For API assistance or integration support, contact us at:

Email: info@netstat.com.au