SDK Documentation
Software Development Kits (SDKs) for integrating with the Netasampark API.
Available SDKs
JavaScript/TypeScript
Official JavaScript SDK for Node.js and browsers.
Installation:
npm install @netasampark/sdk
Usage:
import { NetasamparkClient } from '@netasampark/sdk';
const client = new NetasamparkClient({
apiKey: 'your-api-key',
baseURL: 'https://api.netasampark.com'
});
// Send message
const result = await client.messages.send({
channel: 'whatsapp',
to: '+919876543210',
message: 'Hello!'
});
// Get voters
const voters = await client.voters.list({
page: 1,
per_page: 15
});
Python
Official Python SDK.
Installation:
pip install netasampark-sdk
Usage:
from netasampark import NetasamparkClient
client = NetasamparkClient(
api_key='your-api-key',
base_url='https://api.netasampark.com'
)
# Send message
result = client.messages.send(
channel='whatsapp',
to='+919876543210',
message='Hello!'
)
# Get voters
voters = client.voters.list(page=1, per_page=15)
PHP
Official PHP SDK.
Installation:
composer require netasampark/sdk
Usage:
use Netasampark\Client;
$client = new Client([
'api_key' => 'your-api-key',
'base_url' => 'https://api.netasampark.com'
]);
// Send message
$result = $client->messages()->send([
'channel' => 'whatsapp',
'to' => '+919876543210',
'message' => 'Hello!'
]);
// Get voters
$voters = $client->voters()->list([
'page' => 1,
'per_page' => 15
]);
SDK Features
All SDKs provide:
- Authentication: Automatic token management
- Rate Limiting: Built-in rate limit handling
- Error Handling: Consistent error handling
- Type Safety: TypeScript types / type hints
- Retry Logic: Automatic retry for transient errors
- Webhooks: Webhook signature verification
Getting Started
- Install SDK: Install the SDK for your language
- Get API Key: Obtain API key from admin panel
- Initialize Client: Create client instance
- Make Requests: Start making API calls
Examples
See API Examples for complete code examples.
Next Steps
Need help? Contact Support