WINK Streaming
Command API Reference
Version 1.4.9.1
Document Updated: August 2025
WINK Streaming, Inc.
Overview
This document provides a comprehensive reference for the WINK Streaming Command API, covering WINK Forge, WINK Archive, and WINK Media Router appliances. The API enables programmatic control of video streaming operations, user management, and system administration.
Supported Products
- WINK Forge: Video transcoding and stream management (Firmware 1.6+)
- WINK Archive: Video recording and storage (Firmware 1.1+)
- WINK Media Router: Stream distribution and OTP authentication (Firmware 1.2+)
API Architecture
The WINK API uses XML-based messaging over HTTPS, providing:
- Secure SSL/TLS encrypted communication
- XML request/response format for structured data
- Session-based authentication with optional shared keys
- RESTful design principles for predictable behavior
Note: This document does not cover WINK Crossroad integration APIs or third-party integration commands, which are documented separately.
Getting Started
Authentication
All API calls require authentication using the following XML structure:
<wink_api user='username' pass='password' key='shared_key'>
<req id='unique_id' command='command_name'>payload</req>
</wink_api>
Authentication Parameters
Parameter |
Required |
Description |
user |
Yes |
API username (must have API access level) |
pass |
Yes |
User password |
key |
Optional |
Shared key for enhanced security |
SSL Requirements
All API endpoints require SSL/HTTPS connections. Configure SSL certificates through:
- Navigate to Settings → System Options → SSL Certificate
- Generate self-signed certificate or upload existing certificate
- For development, use the
--insecure
flag with cURL to bypass certificate validation
Example Connection
curl -X POST https://10.130.90.188/api/ \
--insecure \
--data-urlencode "<wink_api user='apiuser' pass='apipass'>
<req id='1' command='version'></req>
</wink_api>" \
-H 'Content-Type: application/xml'
API Testing Tool
WINK Forge includes a built-in API testing interface:
API Testing Tool
Access via: Tools → API Tester
- Test commands without external tools
- View formatted responses
- Save command history
- Export results
Built-in API testing interface
WINK Forge API Commands
1. Version
Command |
version |
Description |
Returns the API version number |
Payload |
None |
Example |
<wink_api user='apiuser' pass='apipass'>
<req id='1' command='version'></req>
</wink_api>
|
Response |
<wink_api>
<resp id="1" command="version" status="ok">1.4</resp>
</wink_api>
|
Return Value |
Numeric API version (e.g., "1.4") |
Command |
start | stop | restart |
Description |
Controls transcoding operations for input streams |
Payload |
GUID of the input stream or 'all' for all streams |
Example |
<wink_api user='apiuser' pass='apipass'>
<req id='1' command='restart'>WF05-2657-1C04-7F1B-5EC0</req>
</wink_api>
|
Response |
<wink_api>
<resp id="1" command="restart" status="ok">WF05-2657-1C04-7F1B-5EC0</resp>
</wink_api>
|
Return Value |
GUID of affected input or error message |
Tip: Use 'all' as the payload to control all streams simultaneously. This is useful for system-wide maintenance or emergency stops.
3. IP Based Input Control
Command |
startip | stopip |
Description |
Controls transcoding based on IP:Port combination |
Payload |
IP address and port (format: IP:PORT) |
Example |
<wink_api user='apiuser' pass='apipass'>
<req id='1' command='stopip'>10.130.90.68:554</req>
</wink_api>
|
Response |
<wink_api>
<resp id="1" command="stopip" status="ok">WF05-2657-1C04-7F1B-5EC0</resp>
</wink_api>
|
Return Value |
GUID of the affected input |
GUID Operations
4. Get GUID
Command |
getguid |
Description |
Returns GUID for a specific IP:Port combination |
Payload |
IP and Port (e.g., 10.130.90.199:554) |
Example |
<wink_api user='apiuser' pass='apipass'>
<req id='1' command='getguid'>10.130.90.199:8382</req>
</wink_api>
|
Response |
<wink_api>
<resp id="1" command="getguid" status="ok">WF05-2657-1C04-7F1B-5EC0</resp>
</wink_api>
|
5. GUID Status
Command |
guidstatus |
Description |
Returns the current status of a stream |
Payload |
GUID string |
Response Values |
- 0 = Not publishing
- 1 = Publishing
- 2 = Blocked
- 3 = Set as unavailable
|
6. Block GUID
Command |
blockguid |
Description |
Blocks video output from viewers |
Payload Options |
- GUID - Block stream (default)
- GUID@0 - Unblock stream
- GUID@2 - Block stream
- GUID@3 - Mark as unavailable
|
Example |
<wink_api user='apiuser' pass='apipass'>
<req id='1' command='blockguid'>WF05-2657-1C04-7F1B-5EC0</req>
</wink_api>
|
Note: Blocked streams display a placeholder image instead of live video. This is useful for privacy compliance or content moderation.
7. Unblock GUID
Command |
unblockguid |
Description |
Restores video output to viewers |
Payload |
GUID string |
IP-Based Operations
8. Block IP
Command |
blockip |
Description |
Blocks video based on IP:Port without knowing GUID |
Payload |
IP:Port combination (e.g., 10.130.90.199:554) |
Response |
Returns the GUID of the blocked stream |
9. Unblock IP
Command |
unblockip |
Description |
Restores video based on IP:Port |
Payload |
IP:Port combination |
Stream Management
10. Input Stream Properties
Command |
input_source |
Description |
Creates or updates video input configuration |
Required (New) |
- title - Stream title
- desc - Stream description
- path - Input URI
- type - Protocol (RTSP, MJPEG, HTTP, UDP, TCP, etc.)
|
Required (Update) |
guid - Existing stream GUID |
Optional Parameters |
fps | Frame rate (decimal) |
width | Video width in pixels |
height | Video height in pixels |
croptop | Pixels to crop from top |
cropright | Pixels to crop from right |
cropbottom | Pixels to crop from bottom |
cropleft | Pixels to crop from left |
rotate | Rotation (90, 180, 270, 0) |
deinterlace | 1=on, 0=off |
ptz_avail | 1=PTZ available, 0=none |
enabled | 1=enabled, 0=disabled |
usrlogic_id | Logical ID number |
usrgroup | Group assignment |
usrlat | Latitude coordinate |
usrlong | Longitude coordinate |
|
Example |
<wink_api user='apiuser' pass='apipass'>
<req id='1' command='input_source'>
<input title='Test Camera'
desc='Testing stream'
type='RTSP'
path='rtsp://192.168.1.100:554/stream1'
fps='30'
width='1920'
height='1080'
enabled='1' />
</req>
</wink_api>
|
11. Input Stream Delete
Command |
input_delete |
Description |
Removes video input and associated outputs |
Payload |
GUID string |
Warning: Deleting an input stream permanently removes all associated output streams. This action cannot be undone.
User Management
12. Create User
Command |
createuser |
Description |
Creates a local user account |
Parameters |
- name - Full name
- username - Login username
- password - User password
- md5 - true/false (password hashing)
- access - Access level:
- 1 = Admin
- 2 = Operator
- 3 = Viewer
- 4 = API Only
|
Example |
<wink_api user='apiuser' pass='apipass'>
<req id='1' command='createuser'>
<name>Billy Armstrong</name>
<username>billy</username>
<password>SecurePass123!</password>
<access>2</access>
</req>
</wink_api>
|
13. Delete User
Command |
deleteuser |
Description |
Removes a user account |
Payload |
XML with username |
14. Change Password
Command |
changepassword |
Description |
Updates user password |
Parameters |
- username - Target user
- password - New password
- md5 - true if pre-hashed
|
System Operations
15. Event Logger
Command |
log |
Description |
Adds entry to system event log |
Payload |
Log message string |
Example |
<wink_api user='apiuser' pass='apipass'>
<req id='1' command='log'>API integration test successful</req>
</wink_api>
|
16. Flush Logs
Command |
flushlogs |
Description |
Clears the event log |
Payload |
None |
17. Reboot Server
Command |
reboot |
Description |
Initiates system reboot |
Payload |
None |
Response |
Error message or immediate reboot |
Warning: This command immediately reboots the system. Ensure all critical operations are complete before executing.
WINK Archive API Commands
Firmware Requirements: Version 1.1 or greater
Archive File Naming: Files are automatically named using the pattern:
TITLE_[YYYY-MM-DD_HH.MM.SS]_GUID.mp4
Example: EastSideSony_[2015-04-03_13.06.18]_WMA5-6E0F-1C04-86F2-E5C4.mp4
1. Version
Same as WINK Forge version command - returns API version number.
2. Archive Control
Commands |
archiver_start | archiver_stop |
Description |
Controls video archiving operations |
Payload |
GUID or blank (blank = all archivers) |
Behavior |
If already recording, creates overlapping instance to ensure no content loss |
Example |
<wink_api user='apiuser' pass='apipass'>
<req id='1' command='archiver_start'>WMA5-6E0F-1C04-86F2-E5C4</req>
</wink_api>
|
Storage Management: Archives automatically maintain 85% disk capacity by removing oldest files when threshold is reached.
3. Archiver Status
Command |
archiver_status |
Description |
Returns archiver configuration and status |
Payload |
GUID or blank (blank = all archivers) |
Response |
<wink_api>
<resp id="11" command="archiver_status" status="ok">
<archiver guid="WMA5-6E0F-1C04-86F2-E5C4"
title="TV2"
desc="Conference Room Feed"
type="RTMP"
path="rtmp://10.130.90.10/public/stream_high"
segmenttime="5"
meta1="Building A"
meta2="Floor 2"
meta3="Room 201"
meta4="PTZ Camera"
enabled="1" />
</resp>
</wink_api>
|
4. Archiver Source
Command |
archiver_source |
Description |
Create or modify archiver configuration |
Parameters |
- guid - Required for updates
- title - Archiver name
- desc - Description
- type - Input type (RTMP, RTSP, HTTP)
- path - Source URI
- segmenttime - Recording duration (5-60 minutes)
- meta1-4 - Metadata tags
- enabled - 1=enabled, 0=disabled
|
5. Archive Delete
Command |
archiver_delete |
Description |
Stop and remove archiver |
Payload |
GUID |
WINK Media Router API
One-Time Password (OTP) Authentication
The OTP system provides secure, time-limited access to video streams. Key features:
- Server-to-server authentication protocol
- Temporary access tokens for video content
- Configurable expiration times
- Integration with application session management
OTP Workflow Diagram
- Application requests OTP token from Media Router
- Media Router generates unique token with expiration
- Application provides token to client
- Client uses token to access video stream
- Token expires after set duration or use
OTP authentication flow
Default Settings: OTP tokens expire after 60 minutes by default. All tokens can be cleared via the Web Administration OTP section.
1. Create OTP Token
Command |
create |
Method |
HTTP POST |
Parameters |
action |
create |
Required |
duration |
Minutes (default: 60) |
Optional |
hash_type |
alpha | numeric | alphanumeric |
Default: alphanumeric |
hash_length |
Max 128 (default: 32) |
Optional |
expiry_url |
Redirect URL on expiry |
Optional |
expiry_message |
Custom expiry message |
Optional |
|
Example |
curl -d "apiuser=apiuser&apipass=apipass&action=create&duration=15&hash_type=numeric&hash_length=20" \
-X POST http://router.example.com/otp/api/
|
Response |
24814928371014572819 |
2. Destroy/Extend OTP
Commands |
destroy | extend |
Description |
Manage existing OTP tokens |
Parameters |
- action - destroy or extend
- token - Existing token string
- duration - Minutes (for extend only)
|
Example |
curl -d "apiuser=apiuser&apipass=apipass&action=extend&token=24814928371014572819&duration=900" \
-X POST http://router.example.com/api/v1/otp/
|
Response |
Success | Failed |
3. Query Token
Command |
tokeninfo |
Description |
Returns token expiration time |
Parameters |
- action - tokeninfo
- token - Token to query
|
Response Format |
YYYY-MM-DD HH:MM:SS |
Code Examples
JavaScript Integration
Complete JavaScript function for API communication:
function exec_api_command() {
// Update UI
document.getElementById("resp_payload").value = "Sending API Command";
// Get connection details
var api_host = document.getElementById("req_ipaddr").value;
var payload = document.getElementById("req_payload").value;
// Create request
var xhttp = new XMLHttpRequest();
// Handle response
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
document.getElementById("resp_payload").value = xhttp.responseText.trim();
}
};
// Send request
xhttp.open("POST", "https://" + api_host.trim() + "/api/", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(payload);
}
// Example usage
var xmlPayload = `<wink_api user='apiuser' pass='apipass'>
<req id='1' command='guidstatus'>WF05-1EDA-1C04-6E33-ABF9</req>
</wink_api>`;
// Call function with payload
document.getElementById("req_payload").value = xmlPayload;
exec_api_command();
Python Integration
import requests
import xml.etree.ElementTree as ET
class WinkAPI:
def __init__(self, host, username, password, verify_ssl=True):
self.host = host
self.username = username
self.password = password
self.verify_ssl = verify_ssl
self.api_url = f"https://{host}/api/"
def execute_command(self, command, payload="", req_id="1"):
# Build XML request
xml_request = f"""<wink_api user='{self.username}' pass='{self.password}'>
<req id='{req_id}' command='{command}'>{payload}</req>
</wink_api>"""
# Send request
response = requests.post(
self.api_url,
data=xml_request,
headers={'Content-Type': 'application/xml'},
verify=self.verify_ssl
)
# Parse response
root = ET.fromstring(response.text)
resp = root.find('resp')
return {
'status': resp.get('status'),
'command': resp.get('command'),
'data': resp.text
}
# Example usage
api = WinkAPI('10.130.90.188', 'apiuser', 'apipass', verify_ssl=False)
# Get version
version = api.execute_command('version')
print(f"API Version: {version['data']}")
# Check stream status
status = api.execute_command('guidstatus', 'WF05-1EDA-1C04-6E33-ABF9')
print(f"Stream Status: {status['data']}")
cURL Examples
Basic Commands
# Get API version
curl -X POST https://forge.example.com/api/ \
--insecure \
--data-urlencode "<wink_api user='apiuser' pass='apipass'><req id='1' command='version'></req></wink_api>" \
-H 'Content-Type: application/xml'
# Start all streams
curl -X POST https://forge.example.com/api/ \
--insecure \
--data-urlencode "<wink_api user='apiuser' pass='apipass'><req id='1' command='start'>all</req></wink_api>" \
-H 'Content-Type: application/xml'
# Create OTP token
curl -d "apiuser=apiuser&apipass=apipass&action=create&duration=60" \
-X POST https://router.example.com/otp/api/
Advanced Examples
# Create new input with full configuration
curl -X POST https://forge.example.com/api/ \
--insecure \
--data-urlencode "<wink_api user='apiuser' pass='apipass'>
<req id='1' command='input_source'>
<input title='Conference Room'
desc='Main conference room HD camera'
type='RTSP'
path='rtsp://admin:password@192.168.1.100:554/stream1'
fps='30'
width='1920'
height='1080'
ptz_avail='1'
usrlat='41.8781'
usrlong='-87.6298'
enabled='1' />
</req>
</wink_api>" \
-H 'Content-Type: application/xml'
Notes & Best Practices
API Versioning
- API methods maintain backward compatibility across minor versions
- Major version changes may introduce breaking changes
- Always verify API compatibility before firmware upgrades
- Test API calls on non-production systems first
Performance Considerations
- Batch operations when possible to reduce API calls
- Implement exponential backoff for retry logic
- Monitor API response times for system health
- Use connection pooling for high-frequency operations
Security Best Practices
- Always use HTTPS for API communications
- Implement API-specific user accounts with minimal permissions
- Rotate API credentials regularly
- Log all API access for audit purposes
- Use shared keys for additional security layers
Integration Tips
- OTP expiry should match application session duration
- Implement proper error handling for all API responses
- Cache GUID lookups to reduce API calls
- Use the built-in API testing tool for development
Development Tip: The API Testing tool in WINK Forge (Tools → API Tester) can export command templates in various programming languages.
Customer Support
Contact Information
Email Support |
support@wink.co |
Phone Support |
+1-312-281-5433 |
Corporate Website |
https://www.wink.co |
Support Requirements
When contacting support, please provide:
- Customer ID
- System serial number or license key
- Firmware version (from version API command)
- Specific API commands causing issues
- Error messages or unexpected responses
- Network topology if relevant
Additional Resources
- Developer Portal: Access code samples and SDKs
- Community Forum: Share experiences with other developers
- Training Videos: API integration tutorials
- Release Notes: Latest API changes and additions
Programming Language Examples: Contact WINK Support for examples in your preferred programming language. While availability isn't guaranteed, we maintain samples for Python, PHP, Java, C#, and Node.js.
© 2025 WINK Streaming, Inc. All rights reserved.
Document Version: 1.4.9.1 - Updated August 2025
Original Issue: August 2022