API Documentation

Developer resources and documentation for integrating with the PetNect API.

API Overview

RESTful API

  • • JSON request/response format
  • • HTTP status code responses
  • • Bearer token authentication
  • • Rate limiting and pagination
  • • Comprehensive error handling

Base Information

Base URL: https://app.petnect.com/api/v1
Content-Type: application/json
Authentication: Bearer {token}

Authentication

Getting Started

The PetNect API uses Bearer token authentication. You'll need to authenticate to access protected endpoints.

1. Login to Get Token

POST /api/v1/auth/login
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "your-password"
}

2. Response

{
  "token": "1|abcd1234...",
  "user": {
    "id": 1,
    "name": "John Doe",
    "email": "user@example.com"
  }
}

3. Use Token in Requests

GET /api/v1/pets
Authorization: Bearer 1|abcd1234...
Content-Type: application/json

Available Endpoints

Authentication

POST /auth/login - Authenticate user
POST /auth/logout - Revoke token
GET /auth/me - Get current user

Pets

GET /pets - List user's pets
GET /pets/{id} - Get specific pet
POST /pets - Create new pet
PUT /pets/{id} - Update pet
DELETE /pets/{id} - Delete pet

Bookings

GET /bookings - List user's bookings
GET /bookings/{id} - Get specific booking
POST /bookings - Create booking request
PUT /bookings/{id}/status - Update booking status

Response Format

Success Response

{
  "success": true,
  "data": {
    "id": 1,
    "name": "Fluffy",
    "type": "cat"
  },
  "message": "Pet retrieved successfully"
}

Error Response

{
  "success": false,
  "error": "Validation failed",
  "errors": {
    "name": ["The name field is required."]
  },
  "code": 422
}

HTTP Status Codes

Success Codes

200 OK - Request successful
201 Created - Resource created
204 No Content - Successful deletion

Error Codes

400 Bad Request - Invalid request
401 Unauthorized - Authentication required
403 Forbidden - Access denied
404 Not Found - Resource not found
422 Validation Error - Invalid data
429 Rate Limited - Too many requests

Rate Limiting

API Rate Limits

To ensure fair usage, the API has the following rate limits:

  • Authenticated requests: 1000 requests per hour
  • Authentication endpoints: 10 requests per minute
  • File uploads: 50 requests per hour

Rate Limit Headers

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1609459200

Interactive Documentation

Swagger UI Documentation

Explore and test our API endpoints with interactive Swagger documentation.

Interactive documentation is available to administrators and in development environments.

SDKs & Libraries

JavaScript/Node.js

Official SDK for JavaScript applications

Coming Soon

Python

Python library for PetNect API

Coming Soon

PHP

Native PHP integration library

Coming Soon

Need API Support?

Have questions about implementing the PetNect API? Our developer support team is here to help.