Machine Users
Authenticate automated systems and integrations with API tokens.
Overview
The VRA GraphQL API offers a flexible, efficient way to query and manipulate data within your Visual Radio Assist environment. Unlike traditional REST APIs, GraphQL allows you to request exactly the data you need in a single query, reducing network overhead and improving performance.API Endpoints
Production Environment
Authentication
All API requests require authentication using a Machine User token. For details on creating Machine Users, see the Machine Users documentation.GraphiQL Authentication
The GraphiQL playground provides automated authentication:- Click the “Authorize with VRA Cloud” button in the GraphiQL interface
- Login with your VRA Cloud manager user credentials
- Select a machine user from the dropdown to automatically authorize the playground
Core Concepts
Programs and Scheduling
The API centers aroundSchedulingProgram objects that represent broadcast programs:
- Programs: Individual broadcast shows or segments
- Presenters: Host information associated with programs
- Recurring Patterns: Schedule repetition using RRule format
- Media Assets: Associated visual and audio content
Media Management
- Media References: Support for external URLs and media file references
- Metadata Handling: Rich media information and categorization
Key Operations
Querying Programs
Retrieve existing program information:Creating/Updating Programs
Use theupsertSchedulingProgram mutation to create or update programs:
Input Variables Example:
RRule Format
VRA uses the iCalendar RRule standard for recurring programs. Common patterns:RRule Testing
Use online tools like rrule.js demo to test and generate RRule strings.Integration Patterns
External Scheduling System Sync
Error Handling
Common GraphQL Errors
Validation Errors
Best Practices
Query Optimization
- Request Only Needed Fields: GraphQL allows precise field selection
- Use Fragments: Reuse common field sets across queries
- Batch Operations: Combine multiple mutations when possible
- Implement Caching: Cache frequently accessed data
Rate Limiting
- Implement request throttling in your application
- Monitor API usage through VRA Cloud dashboard
- Contact support for rate limit adjustments if needed
Development Workflow
1. Exploration with GraphiQL
Use the interactive GraphiQL playground to:- Explore the complete schema
- Test queries and mutations
- Validate data structures
- Generate example code
2. Schema Introspection
The GraphiQL interface provides full schema introspection, showing:- Available queries and mutations
- Field types and relationships
- Required vs optional fields
- Deprecation notices
3. Testing Environment
Development environment access must be requested through support@visualradioassist.live:- Request development environment access for integration testing
- Create test programs and data in the development environment
- Validate data transformations
- Test error scenarios
Troubleshooting
Authentication Issues
Schema Validation
Use GraphiQL’s built-in validation to check:- Query syntax
- Field availability
- Type compatibility
- Required field presence
Debugging Tips
- Enable detailed logging in your application
- Use GraphiQL for query testing and validation
- Monitor VRA Cloud audit logs for API activity
- Check network connectivity and DNS resolution
Migration and Updates
API Versioning
VRA maintains API compatibility but may introduce:- New fields and mutations
- Deprecation warnings
- Enhanced validation rules
Schema Updates
- Monitor the GraphiQL playground for schema changes
- Subscribe to status.visualradio.cloud for API availability
- Check changelog.visualradioassist.live for significant documentation changes
- Test integrations against new schema versions
- Update code to use new features and deprecate old patterns