DELETE https://solarproof.com.au/apidata.php

Description

This endpoint allows you to unsubscribe from webhook events by removing a previously registered webhook URL. Once unsubscribed, Solar Proof will no longer send events to that URL.

Selective Unsubscription: Unsubscribing removes all event subscriptions for the specified webhook URL. If you want to stop receiving only specific event types, you'll need to unsubscribe completely and then re-subscribe to only the events you want.

Request Parameters

Query Parameters

Parameter Type Required Description
action string Required Must be unsubscribe_customer
api_key string Required Your unique API key for authentication

Request Body (JSON)

Field Type Required Description
hookUrl string Required The exact webhook URL you want to unsubscribe. Must match the URL used during subscription

Response

Success Response (200 OK)

Success Response JSON
{
  "success": true,
  "message": "Webhook unsubscribed successfully"
}

Error Response (400 Bad Request)

Error Response JSON
{
  "success": false,
  "message": "Error description"
}

Common Error Messages

Error Message Cause Solution
Empty request body No JSON data sent in request Ensure you're sending a valid JSON body with the request
Invalid JSON Malformed JSON in request body Validate your JSON syntax before sending
hookUrl parameter is required Missing or empty hookUrl field Include the webhook URL in the request body
Invalid webhook URL format The URL provided is not a valid format Ensure the URL is properly formatted and includes the protocol (https://)
Invalid API key The provided API key is invalid or expired Verify your API key is correct and active
No matching webhook found for this user The webhook URL is not subscribed or doesn't belong to your account Verify the URL is correct and was previously subscribed using your API key

Code Examples

cURL bash
curl -X POST "https://solarproof.com.au/apidata.php?action=unsubscribe_customer&api_key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "hookUrl": "https://your-domain.com/webhooks/solarproof"
  }'
JavaScript (Fetch) javascript
const unsubscribeWebhook = async () => {
  const response = await fetch(
    'https://solarproof.com.au/apidata.php?action=unsubscribe_customer&api_key=YOUR_API_KEY',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        hookUrl: 'https://your-domain.com/webhooks/solarproof'
      })
    }
  );
  
  const data = await response.json();
  console.log(data);
};

unsubscribeWebhook();
PHP php
<?php
$api_key = 'YOUR_API_KEY';
$url = 'https://solarproof.com.au/apidata.php?action=unsubscribe_customer&api_key=' . $api_key;

$data = [
    'hookUrl' => 'https://your-domain.com/webhooks/solarproof'
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
?>
Python python
import requests

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

data = {
    'hookUrl': 'https://your-domain.com/webhooks/solarproof'
}

response = requests.post(url, json=data)
print(response.json())

Common Use Cases

Changing Webhook URLs

When migrating to a new webhook endpoint, unsubscribe the old URL before subscribing the new one.

Disabling Integration

When temporarily disabling an integration, unsubscribe to stop receiving events.

Security Response

Immediately unsubscribe if a webhook URL is compromised to prevent unauthorized access.

Important Notes:
  • The hookUrl must exactly match the URL used during subscription (case-sensitive)
  • Unsubscribing removes ALL event subscriptions for that URL
  • You can only unsubscribe webhooks that were created with your API key
  • Once unsubscribed, you'll immediately stop receiving events at that URL
  • This action cannot be undone - you'll need to re-subscribe if you want to resume events

Security Considerations

Authorization: You can only unsubscribe webhooks that belong to your account (created with your API key). This prevents unauthorized users from disrupting your integrations.

No Confirmation Required: Unsubscription is immediate and doesn't require confirmation. Ensure you're unsubscribing the correct URL before making the API call.

Audit Trail: Consider keeping logs of webhook subscriptions and unsubscriptions in your application for audit purposes.

Related Endpoints