If you don't have a project yet and you're just trying to experiment with the package, you can create a new directory, initialize a new Go module there, and then try to fetch the dependency:
mkdir myproject
cd myproject
go mod init myproject
go get github.com/deploymenttheory/go-jamfpro-api@latest
to add module requirements and sums:
go mod tidy
package main
import (
"fmt"
"log"
jamf "github.com/deploymenttheory/go-jamfpro-api"
)
func main() {
// Credentials and URL for Jamf API
username := "your-jamf-api-account"
password := "your-jamf-api-account-password"
url := "your-jamf-instance" // e.g., "yourcompany.jamfcloud.com"
// Set up the configuration for the Jamf Pro API client
cfg := jamf.Config{
AuthMethod: jamf.BasicAuthConfig{
Username: username,
Password: password,
},
URL: url,
HTTPClient: &http.Client{},
HttpRetryTimeout: 30 * time.Second, // Optional, defaults to 10 seconds if not defined
}
}
✅ GET /JSSResource/allowedfileextensions - GetAllowedFileExtensions retrieves all allowed file extensions
✅ GET /JSSResource/allowedfileextensions/id/{id} - GetAllowedFileExtensionByID retrieves the allowed file extension by its ID
✅ GET /JSSResource/allowedfileextensions/extension/{extensionName} - GetAllowedFileExtensionByName retrieves the allowed file extension by its name
✅ POST /JSSResource/allowedfileextensions/id/0 - CreateAllowedFileExtension creates a new allowed file extension
❌ PUT /JSSResource/allowedfileextensions/id/{id} - UpdateAllowedFileExtensionByID (API doesn't support update)
✅ DELETE /JSSResource/allowedfileextensions/id/{id} - DeleteAllowedFileExtensionByID deletes an existing allowed file extension by ID
✅ DELETE /JSSResource/allowedfileextensions/extension/{extensionName} - DeleteAllowedFileExtensionByNameByID deletes an existing allowed file extension by resolving its name to an ID
Departments - /JSSResource/departments
✅ GET /id/{id} - GetDepartmentByID retrieves the Department by its ID.
✅ GET /name/{name} - GetDepartmentByName retrieves the Department by its name.
✅ GET / - GetDepartments retrieves all departments.
✅ POST / - CreateDepartment creates a new Department.
✅ PUT /id/{id} - UpdateDepartmentByID updates an existing Department by its ID.
✅ PUT /name/{name} - UpdateDepartmentByName updates an existing Department by its name.
✅ DELETE /id/{id} - DeleteDepartmentByID deletes an existing Department by its ID.
✅ DELETE /name/{name} - DeleteDepartmentByName deletes an existing Department by its name.
SSO Failover - /api/v1/sso/failover/generate
✅ GET /api/v1/sso/failover - GetSSOFailoverSettings retrieves the current failover settings
✅ PUT /api/v1/sso/failover/generate - UpdateFailoverUrl updates failover url, by changing failover key to new one, and returns new failover settings
Progress Summary
Total Endpoints: 188
Covered: 1
Not Covered: 187
Partially Covered: 0
Notes
No preview api endpoints will be covered by this sdk. Only generally available endpoints will be covered.