Skip to content

A collection of go based sdk functions for various apple services for enterprise device management and other modern workplace activities

License

Notifications You must be signed in to change notification settings

deploymenttheory/go-api-sdk-apple

Go API SDK for Apple Services

Go Reference Go Report Card License

This repo offers a collection of Go based SDKs and tools for interacting with various Apple API services and device management services, including:

  • iTunes Search API
  • Apple Business Manager / Apple School Manager API
  • Apple Device Management API (MDM)

Features

  • Clean, idiomatic Go API
  • Fluent builder patterns for constructing API requests
  • Comprehensive error handling
  • Configurable logging with zap
  • Automatic retries with configurable parameters
  • Extensive test coverage
  • Complete examples for all supported operations

Supported Services

iTunes Search API

The SDK provides a complete implementation of the iTunes Search API, allowing you to:

  • Search for content across iTunes, App Store, iBooks Store, and Mac App Store
  • Look up content by ID, UPC, EAN, ISRC, or ISBN
  • Filter results by media type, entity, country, and more

Apple Business Manager / Apple School Manager API

Complete implementation of the Apple Business Manager API with modern Go practices:

Devices API:

  • Get organization devices with filtering and pagination
  • Get detailed device information by serial number
  • Support for all device types (iPhone, iPad, Mac, Apple TV, Apple Watch)

Device Management Services API:

  • List device management services in an organization
  • Get device serial numbers assigned to services
  • Assign/unassign devices to/from management services
  • Get device management service assignments and information
  • Track device activity operations

Key Features:

  • Centralized Architecture: Unified error handling, pagination, and query building
  • Resty v3 Integration: Built on latest Resty v3 with best practices
  • JWT Authentication: Built-in Apple JWT token generation and management
  • Structured Logging: Comprehensive request/response logging with zap
  • Type Safety: Full generics support with structured response models
  • Pagination: Automatic pagination with iterators and collectors
  • Context Support: Context-aware operations for timeouts and cancellation

Quick Start:

Get started quickly with multiple client setup options:

// Method 1: Simple setup with environment variables
axmClient, err := axm.NewClientFromEnv()
if err != nil {
    log.Fatalf("Failed to create client: %v", err)
}

// Create service clients
devicesClient := devices.NewClient(axmClient)
deviceManagementClient := devicemanagement.NewClient(axmClient)

// Get organization devices
ctx := context.Background()
response, err := devicesClient.GetOrganizationDevices(ctx, &devices.GetOrganizationDevicesOptions{
    Fields: []string{
        devices.FieldSerialNumber,
        devices.FieldDeviceModel,
        devices.FieldStatus,
    },
    Limit: 100,
})

if err != nil {
    log.Fatalf("Error getting devices: %v", err)
}

fmt.Printf("Found %d devices\n", len(response.Data))

📖 Complete Quick Start Guide →

The guide covers 6 different client setup methods, from simple environment variables to advanced builder patterns with full customization options.

Apple Device Management API

Integration with Apple Device Management for:

  • Mobile Device Management (MDM) operations
  • Configuration profile management
  • App and book distribution
  • Declarative device management

Examples

Explore the examples directory for comprehensive examples of using the SDK with different Apple services.

Documentation

For detailed documentation, see:

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License.

About

A collection of go based sdk functions for various apple services for enterprise device management and other modern workplace activities

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages