Skip to main content

Quick Start

This guide walks you through making your first API call in under 5 minutes.

Prerequisites

  • An API key or access credentials (request access)
  • A tool to make HTTP requests (curl, Postman, or your preferred HTTP client)

Step 1: Get Your Credentials

If you have an API key, you're ready to go. Your key looks like: ak_live_xxxxxxxxxxxxx

Option B: Get an Access Token

Exchange your credentials for a JWT token:

curl -X POST "https://platform.powerverse.com/auth/token" \
-H "Content-Type: application/json" \
-d '{
"grant_type": "client_credentials",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}'

Response:

{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}

Step 2: Make Your First Request

Using API Key

curl -X GET "https://platform.powerverse.com/inventory-service/sites" \
-H "X-API-Key: ak_live_xxxxxxxxxxxxx" \
-H "Accept: application/json"

Using Bearer Token

curl -X GET "https://platform.powerverse.com/inventory-service/sites" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Accept: application/json"

Step 3: Explore the Response

A successful response looks like:

{
"data": [
{
"id": "sit_abc123",
"name": "London Charging Hub",
"location": "London, UK",
"status": "active",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "sit_def456",
"name": "Manchester Depot",
"location": "Manchester, UK",
"status": "active",
"created_at": "2024-01-16T14:20:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2,
"total_pages": 1
}
}

Common Operations

Create a Resource

curl -X POST "https://platform.powerverse.com/inventory-service/sites" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Birmingham Charging Station",
"location": "Birmingham, UK"
}'

Update a Resource

curl -X PATCH "https://platform.powerverse.com/inventory-service/assets/ast_abc123" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Charger Name"
}'

Delete a Resource

curl -X DELETE "https://platform.powerverse.com/inventory-service/assets/ast_abc123" \
-H "Authorization: Bearer YOUR_TOKEN"

Try it in Different Languages

import requests

response = requests.get(
"https://platform.powerverse.com/inventory-service/sites",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Accept": "application/json"
}
)

sites = response.json()
print(sites)

What's Next?

Now that you've made your first API call:

  1. Authentication - Learn about all auth methods
  2. API Reference - Explore available endpoints
  3. Error Handling - Handle errors gracefully
  4. Rate Limits - Understand usage limits