> ## Documentation Index
> Fetch the complete documentation index at: https://docs.riyadhparking.sa/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> A step-by-step guide to quickly integrate with the Riyadh Parking API.

# Quickstart Guide

This guide provides a step-by-step approach to integrating with the **Riyadh Parking API** for operators and developers.

## Prerequisites

Before getting started, ensure you have the following:

* **API Credentials**: `Client ID` and `Client Secret` provided by Riyadh Parking administration.

* **Development Environment**: A backend server to securely make API requests.

* **Postman or cURL**: For testing API requests before implementation.

## Step 1: Authenticate and Get an API Token

To use the API, you need an access token. Send a `POST` request to obtain one.

### **Request:**

```bash theme={null}
curl -X POST "https://api.riyadhparking.com/auth/public/token" \
  -H "X-Client-Id: your-client-id" \
  -H "X-Client-Secret: your-client-secret"
```

### **Response:**

```json theme={null}
{
  "code": 200,
  "message": "Successful operation",
  "data": {
    "token": "your_generated_token"
  }
}
```

Save the token for use in subsequent API calls.

## Step 2: Check Site Capacity

Retrieve the available parking slots for a given zone.

### **Request:**

```bash theme={null}
curl -X GET "https://api.riyadhparking.com/sites/public/site-capacity?zoneId=your-zone-id" \
  -H "Authorization: Bearer your_generated_token"
```

### **Response:**

```json theme={null}
{
  "zoneId": "your-zone-id",
  "availableSlots": 95
}
```

## Step 3: Validate a Parking Ticket

Verify if a vehicle has an active ticket.

### **Request:**

```bash theme={null}
curl -X POST "https://api.riyadhparking.com/tickets/public/active-ticket" \
  -H "Authorization: Bearer your_generated_token" \
  -H "Content-Type: application/json" \
  -d '{
    "zoneId": "your-zone-id",
    "plateNumber": "ABC123",
    "plateType": "Private"
  }'
```

### **Response:**

```json theme={null}
{
  "hasActiveTicket": true
}
```

## Step 4: Handle Violations

Report a parking violation by submitting details.

### **Request:**

```bash theme={null}
curl -X POST "https://api.riyadhparking.com/violation/public/create" \
  -H "Authorization: Bearer your_generated_token" \
  -H "Content-Type: multipart/form-data" \
  -F "plateNumber=ABC123" \
  -F "plateType=Private" \
  -F "zoneId=your-zone-id" \
  -F "violationType=NO_TICKET"
```

### **Response:**

```json theme={null}
{
  "id": "violation_uuid",
  "canTow": false
}
```

## Next Steps

* Explore [Authentication](./authentication) for more security options.
* Check the [Full API Reference](./api-reference/introduction) for more details.
