Skip to main content

Submit Location Entry

curl -X POST https://autonomous.stu.nighthawkcodingsociety.com/api/entries \
  -H "Content-Type: application/json" \
  --include-credentials \
  -d '{
    "name": "John Doe",
    "email": "[email protected]",
    "address": "123 Poway Rd, Poway, CA"
  }'
Submits a new location verification entry for account qualification. Users will be contacted within 3 business days if they live in Poway and qualify for an account.

Request Body

name
string
required
Full name of the applicant
email
string
required
Valid email address for contact
address
string
required
Complete street address in Poway, CA

Response

message
string
Success confirmation message
id
number
Unique identifier for the submitted entry

Success Response

{
  "message": "Entry submitted successfully",
  "id": 42
}

Error Response

{
  "error": "Invalid email format"
}

Get All Entries

curl https://autonomous.stu.nighthawkcodingsociety.com/api/entries \
  -H "Content-Type: application/json" \
  --include-credentials
Retrieves all location verification entries (public view).

Response

Returns an array of entry objects.
[].name
string
Applicant’s full name
[].email
string
Applicant’s email address
[].address
string
Applicant’s street address
[].id
number
Unique entry identifier
[].created_at
string
ISO 8601 timestamp when the entry was created

Success Response

[
  {
    "id": 1,
    "name": "John Doe",
    "email": "[email protected]",
    "address": "123 Poway Rd, Poway, CA",
    "created_at": "2026-03-01T10:30:00Z"
  },
  {
    "id": 2,
    "name": "Jane Smith",
    "email": "[email protected]",
    "address": "456 Oak St, Poway, CA",
    "created_at": "2026-03-02T14:15:00Z"
  }
]

Empty Response

When no entries exist:
[]

Real Implementation

From navigation/verify.html:98-146:

Submitting an Entry

form.addEventListener('submit', async (e) => {
  e.preventDefault();

  const name = document.getElementById('name').value;
  const email = document.getElementById('email').value;
  const address = document.getElementById('address').value;

  const res = await fetch(`${API_BASE}/entries`, {
    ...fetchOptions,
    method: 'POST',
    body: JSON.stringify({ name, email, address })
  });

  const data = await res.json();
  if (!res.ok) {
    message.textContent = data.error || 'Failed to submit entry.';
  } else {
    message.textContent = 'Entry submitted successfully!';
    form.reset();
  }
});

Viewing All Entries

viewEntriesBtn.addEventListener('click', async () => {
  const res = await fetch(`${API_BASE}/entries`, fetchOptions);
  const data = await res.json();

  if (!res.ok) {
    message.textContent = data.error || 'Unable to fetch entries.';
    return;
  }

  if (!data.length) {
    entries.innerHTML = '<p>No entries found.</p>';
    return;
  }

  data.forEach(entry => {
    const div = document.createElement('div');
    div.className = 'entry';
    div.innerHTML = `<strong>${entry.name}</strong><br>${entry.email}<br>${entry.address}`;
    entries.appendChild(div);
  });
});

Authentication

Both endpoints require credentials to be included:
const fetchOptions = {
  method: 'GET',
  mode: 'cors',
  cache: 'default',
  credentials: 'include',
  headers: {
    'Content-Type': 'application/json'
  }
};

Use Cases

  • Account Qualification: Verify that users live within the Poway service area
  • Address Validation: Collect verified addresses for service planning
  • Public Transparency: Allow users to view all submitted entries

Build docs developers (and LLMs) love