The OpCon API allows users to programmatically add jobs to schedules, enabling dynamic automation and integration with external systems. This guide provides a step-by-step overview of how to use the API to add jobs to schedules, including required fields and example requests.
Required Information
To add a job to a schedule using the API, you will need the following information:
- Schedule name or ID
- Job name or ID
- Frequency and instance details
- Any instance properties or overrides
- Authentication token with appropriate permissions
Example Request
Below is an example of a POST request to the /schedule-actions endpoint to add a job to a schedule:
POST /api/schedule-actions HTTP/1.1
Host: your-opcon-server
Authorization: Token your-auth-token
Content-Type: application/json
{
"scheduleName": "DailyProcessing",
"action": "AddJob",
"jobName": "DataImportJob",
"frequency": "Daily",
"instanceProperties": i
{
"name": "InputFile",
"value": "data_2024_01_01.csv"
}
]
}
Tips
- Ensure the job and schedule names are spelled correctly and exist in the system.
- Use the Swagger interface to test your request before deploying it in production.
- Check the API response for success confirmation or error messages.
- Use instance properties to customize job behavior for specific runs.