Skip to main content

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:

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:

{
  "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:

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

Response:

{
  "zoneId": "your-zone-id",
  "availableSlots": 95
}

Step 3: Validate a Parking Ticket

Verify if a vehicle has an active ticket.

Request:

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:

{
  "hasActiveTicket": true
}

Step 4: Handle Violations

Report a parking violation by submitting details.

Request:

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:

{
  "id": "violation_uuid",
  "canTow": false
}

Next Steps