Sendstack APIs
  • Introduction
  • The Basics
    • Set up your account
    • Base URLs
    • Authentication
    • Postman
    • Responses and Errors
    • Webhook Verification
    • Pagination
    • Rate Limiting
    • Session
  • Guides
    • Integrated Partners
    • Manual Partners
    • Connected Partners
    • Connected Platforms
    • Payments
    • Addresses and Locations
    • Delivery Statuses
    • Order Tracking
    • Common Terminology
    • Packaging
    • Pay on Delivery
    • Roles and Permissions
      • Associates
      • Operators
      • Admins
      • Super Admins
      • Tabular presentation
    • Websockets
  • Delivery Management APIs
    • Wallet
      • Get Wallet Balance
      • Get Wallet Transactions
    • Locations
      • Get Mapped Locations
      • Get Countries
    • Estimates
      • Get Delivery Price Estimate
    • Partners
      • Get Partners
      • Get Partner
      • Update Partner Profile
      • Add Partner Off Days
      • Delete Partner Off Day
    • Packaging
    • Categories
    • Bookings
      • New Booking
      • Generate POD account number
      • Fetch Deliveries
      • Update Delivery Details
      • Update Drop Statuses
      • Cancel Drops
      • Reschedule Delivery
      • Update Delivery Window
      • Assign Drop
    • Status Tracking
      • Track Delivery Status
    • Messaging
      • Send Customer Message
      • Add Private Note
      • Update note status
    • Sample Webhook Payloads
      • New delivery
      • Updated delivery status
      • New internal note
      • New customer message
      • Pickup attempt
      • Dropoff attempt
      • Pickup window updated
      • Delivery window updated
  • Live Tracking APIs
    • Devices
      • Get Devices
    • Positions
      • Get All Positions
      • Get Device Position History
      • Stream Positions
    • Geofences
      • Create Geofence
      • Update Geofence
      • Fetch Geofences
      • Fetch Single Geofence
    • Events
      • Create Events
        • Overspeed Event
        • Low Battery Event
        • No Movement Event
        • No Signal Event
        • Geofence In Event
        • Geofence Out Event
      • Update Events
        • Overspeed Event
        • Low Battery Event
        • No Movement Event
        • No Signal Event
        • Geofence In Event
        • Geofence Out Event
      • Fetch Events
      • Fetch Single Event
    • Sample Wehook Payloads
      • Overspeed Event
      • Low Battery Event
      • No Movement Event
      • No Signal Event
      • Geofence In Event
      • Geofence Out Event
Powered by GitBook
On this page
  1. The Basics

Session

PreviousRate LimitingNextGuides

Last updated 3 months ago

Generate Session

To establish a websocket connection, you must first generate a session ID. This session ID is required for authenticating your websocket connection.

Request

  • Endpoint: POST {baseUrl}/auth/session

  • Headers: Provide your appId and appSecret in the request headers.

Response

  • The session ID is included in the response body as shown below.

  • Session Expiry: The generated session ID is valid for 6 hours. After expiry, you will need to generate a new session.

  • To connect to the websocket, include the session ID as a request query param. Detailed instructions on how to establish a websocket connection can be found

{
    "status": true,
    "message": "Session successfully generated",
    "data": {
        "session": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOnsiYXBwSWQiOiI2NjQyMDk3IiwiYXBwU2VjcmV0IjoiQUNVTEdFV1VaVlE5UlI4NVJBVktLMlRBTEFSOVlSRFEifSwiaWF0IjoxNzQwNDY1NjAzLCJleHAiOjE3NDA0ODcyMDN9.1pEoVBbXvgeDEZHhSjSUFUfN7GEe-EhDXIxUjy7A6oI",
        "expiresAt": "2025-02-25T12:40:03.965Z"
    }
}

here