Estimated Time: 5-10 minutes to complete this guide and make your first successful API call.
1

Get Your API Key

First, you'll need an API key to authenticate your requests. This unique key identifies your account and grants access to your data.

  1. Log into your Solar Proof account at solarproof.com.au
  2. Navigate to SettingsAPI Access
  3. Click "Generate API Key"
  4. Copy your API key and store it securely
Keep it secure: Your API key provides full access to your account. Never share it publicly or commit it to version control. See our Authentication guide for security best practices.
2

Make Your First Request

Let's fetch all customers from your account. This is a simple GET request that requires only your API key.

Using cURL (Command Line)

Terminal / Command Prompt bash
curl "https://solarproof.com.au/apidata.php?action=getallcustomers&api_key=YOUR_API_KEY"

Using JavaScript (Node.js or Browser)

JavaScript javascript
const apiKey = 'YOUR_API_KEY';

fetch(`https://solarproof.com.au/apidata.php?action=getallcustomers&api_key=${apiKey}`)
  .then(response => response.json())
  .then(data => {
    console.log('Success!', data);
    console.log(`Found ${data.length} customers`);
  })
  .catch(error => console.error('Error:', error));

Using Python

Python python
import requests

api_key = 'YOUR_API_KEY'
url = f'https://solarproof.com.au/apidata.php?action=getallcustomers&api_key={api_key}'

response = requests.get(url)
data = response.json()

print(f"Success! Found {len(data)} customers")
print(data)

Using PHP

PHP php
<?php
$api_key = 'YOUR_API_KEY';
$url = "https://solarproof.com.au/apidata.php?action=getallcustomers&api_key={$api_key}";

$response = file_get_contents($url);
$data = json_decode($response, true);

echo "Success! Found " . count($data) . " customers\n";
print_r($data);
?>

Expected Response

You should receive a JSON array containing your customers. Each customer object includes fields like pkcustomerid, customer_email, customer_name, and more.

3

Create a New Customer

Now let's create a customer using a POST request. This demonstrates how to send data to the API.

Using cURL

Create Customer bash
curl -X POST "https://solarproof.com.au/apidata.php?action=createcustomer&api_key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "customer_email": "test@example.com",
      "customer_name": "Test Customer",
      "customer_type": "RESIDENTIAL",
      "customer_phone": "0412345678"
    }
  }'

Using JavaScript

Create Customer javascript
const apiKey = 'YOUR_API_KEY';

fetch(`https://solarproof.com.au/apidata.php?action=createcustomer&api_key=${apiKey}`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    data: {
      customer_email: 'test@example.com',
      customer_name: 'Test Customer',
      customer_type: 'RESIDENTIAL',
      customer_phone: '0412345678'
    }
  })
})
  .then(response => response.json())
  .then(data => {
    console.log('Customer created!', data);
  })
  .catch(error => console.error('Error:', error));

Expected Response

You'll receive a success message with the newly created customer's ID. You can now fetch this customer using the Get Customer endpoint.

4

Set Up Webhooks (Optional)

Webhooks let you receive real-time notifications when events occur in Solar Proof. This is perfect for keeping external systems in sync.

Subscribe to Customer Created Events

Subscribe to Webhook bash
curl -X POST "https://solarproof.com.au/apidata.php?action=subscribe_customer&api_key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "hookUrl": "https://your-domain.com/webhooks/solarproof",
    "type_request": "customer_created"
  }'

When you create a new customer, Solar Proof will automatically send a POST request to your webhook URL with the customer data.

Learn More: Check out our Webhooks documentation for details on all 6 available events and how to handle them.

What's Next?

You've made your first API calls! Here are some next steps to continue building your integration:

Common Integration Patterns

Here are some popular ways developers use the Solar Proof API:

CRM Synchronization

Use webhooks to automatically sync new Solar Proof customers to your CRM (Salesforce, HubSpot, etc.) when they're created.

Custom Dashboards

Fetch customer and project data to build custom reporting dashboards with your preferred analytics tools.

Team Notifications

Subscribe to project and customer events to send real-time notifications to Slack, Teams, or email when important actions occur.

Workflow Automation

Build automated workflows that trigger actions in other systems based on Solar Proof events (e.g., create tasks when proposals are published).

Troubleshooting

Issue Possible Cause Solution
401 Unauthorized Invalid or missing API key Verify your API key is correct and included in the URL
Empty response No data matches your request Check that you have customers/projects in your account
CORS error (browser) Making API calls from client-side JavaScript Move API calls to your server to keep your API key secure
Invalid JSON Malformed request body Validate your JSON syntax before sending POST requests
Need Help? If you run into issues or have questions, check out our detailed endpoint documentation or contact our support team at support.solarproof.com.au