Schedule Run API Endpoints and Route Errors

Updated by Jessica Holman

Below, we’ve listed out the existing route, the new route, and the functionality for the changed routes.

The following parameters are required to trigger the schedule in Sofy:

  • x-sofy-auth-key: To retrieve your subscription key, navigate to Account > Account Settings > API Key.
  • scheduledRunGuid: To retrieve your scheduledRunGuid as per the new route, navigate to Automation > Runs & Results and click on the CI/CD Settings integration icon next to the schedule name to capture the scheduledRunGuid.

Functionality

Trigger a scheduled automated test run.

Schedule Run Route

Status cURL uses ScheduleTestRunsGroupID to fetch the status of the scheduled run.

With Application Hash
curl --location --request POST "https://public.sofy.ai/scheduler-microservice/scheduled-runs/:scheduledRunGuid/execute?appHash=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ` 
--header "x-sofy-auth-key: XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
Replace the placeholder ScheduleRunGUID and authentication key values with the actual values.
Without Application Hash
curl --location --request POST "https://public.sofy.ai/scheduler-microservice/scheduled-runs/:scheduledRunGuid/execute" ` 
--header "x-sofy-auth-key: XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
Replace the placeholder authentication key value with the actual value.

Response:

{ 
"data": [
{
"scheduleTestRunsGroupID": XXXXXX
}
],
"message": "Test runs are scheduled and in queue, Login to https://devtest.sofy.ai/ for more info." }

Error Response:

{ 
"error": {
"message": "Error message.",
"details": "Error details.",
"timestamp": "2023-10-23T09:23:51.845Z"
}
}

Schedule Automated Test Run Error Codes

  1. Error Message: "The scheduledRunGuid is either invalid or not found."
    • Status Code: 400 
    • Reason: Scheduled run not found.
    • Resolution: Ensure that the provided scheduled run GUID is correct and that the scheduled run is active.
  2. Error Message: "Unable to extract application details for the scheduled automated test run. Either appHash is invalid or application does not exist."
    • Status Code: 400 
    • Reason: Application details not found.
    • Resolution: Ensure that the provided application hash is correct, and that the application is active.
  3. Error Message: "Release is either expired or does not exist."
    • Status Code: 400 
    • Reason: Release not found.
    • Resolution: Create a new release from the Sofy portal.
  4. Error Message: "The testRunGroupId is either invalid or not found."
    • Status Code: 400 
    • Reason: Test run group not found.
    • Resolution: Make sure that the test run group id is correct and belongs to the scheduled automated test run in context.
  5. Error Message: "Missing required headers." *
    • Status Code: 500 
    • Reason: The required headers were not passed to the microservice from gateway.
    • Resolution: Contact Sofy support.


How did we do?