Create or Update Program

Creates or updates a program, its modules, tests and other program settings in StartExam.

Request Information

Scheme

POST https://api.startexam.com/v1/program

URI Parameters

None

Body Parameters

Json with the CreateOrUpdateProgramQuery:

  • ProgramId - Program identifier. Generate a new guid to create a program, or pass an existing StartExam guid to update a program.
  • ProgramExternalId - Program external identifier. Pass your own string ID instead of guid for easier integration (optional).
  • ProjectId - Project identifier, guid from StartExam. Cannot be updated.
  • CenterId - Center identifier, guid from StartExam. Cannot be updated.
  • ProgramTitle - name of the program. Max length: 100 symbols. Can be used for renaming.
  • ProgramStatus - status of the program. Supported values: active , archived , deleted. Can be used for soft delete.
  • ProgramIsManual - pass true if you want to have full control of the registration. Cannot be updated.
  • Modules - full or partial list of modules that need to be created or updated:
  • ModuleId - Module identifier. Generate a new guid to create a module, or pass an existing StartExam guid to update a module.
  • ModuleExternalId - Module external identifier. Pass your own string ID instead of guid for easier integration (optional).
  • ModuleTitle - name of the module. Max length: 100 symbols. Can be used for renaming.
  • ModuleOrder - relative order of the module in program. If null, modules will be added one by one. Can be used for reordering.
  • ModuleTests - full or partial list of module tests that need to be created or updated:
  • ModuleTestId - ModuleTest identifier. Pass a new guid to create a module test, or pass an existing guid to update a module test.
  • TestId - Test identifier, guid from StartExam. Cannot be updated. One module cannot have two module tests with the same TestId.
  • ModuleTestMaxAttempts - Number of attempts, integer. Pass null to make unlimited. Can be updated.
  • ModuleTestPassingPercentage - Passing percentage, integer. Pass null if you wish any finished attempt to be considered as successfully passed. Can be updated.
  • ModuleTestStartDate - test link activation time, UTC, ISO 8601. Can be null. Can be updated.
  • ModuleTestEndDate - test link expiration time, UTC, ISO 8601. Can be null. Can be updated.
  • ModuleTestOrder - relative order of the module test in module. If null, module tests will be added one by one. Can be used for reordering.
  • Delete - Removes module test from program, deletes all not started attempts for this module test.
  • UpdateAttempts - If true method will try to update all new attempts (not started) for this module test. Can be used to automatically update max attempts, start date, end date. Method never updates finished attempts and never recalculates old results. If false method doesn't update any attempts.

Request Examples

Example 1: Create new Program with two Modules using external IDs
Example 2: Update partially Module 1 and its ModuleTest.
Example 3: Update partially Program fields.

POST https://api.startexam.com/v1/program HTTP/1.1
Host: api.startexam.com
Accept: application/json; charset=utf-8
Authorization: SharedKey 99:f52JP7GQd0xqrBzMO1NWTNVGzLENymgdUXu/Ie++NX4=
Content-Type: application/json; charset=utf-8
Content-Length: 1516
Date: Thu, 21 Nov 2024 06:47:35 GMT

{
  "programId": null,
  "programExternalId": "my-program-555",
  "projectId": "56675cff-41ea-4b55-be9c-fd13db8f7e92",
  "centerId": "601bc3b6-c930-4dd8-b637-a9cd7618fea2",
  "folderTitle": "My Api Programs",
  "programTitle": "Program 2024. Knowledge check",
  "programStatus": "active",
  "programIsManual": true,
  "modules": [
    {
      "moduleId": null,
      "moduleExternalId": "my-module-1001",
      "moduleTitle": "Module 1",
      "moduleOrder": 1,
      "moduleTests": [
        {
          "moduleTestId": "7a57b73a-d2b4-44f8-86b9-8b9ffc3c8d08",
          "testId": "4955f4ef-cd1c-4f15-8245-a4c9202b9525",
          "moduleTestMaxAttempts": 3,
          "moduleTestPassingPercentage": 70,
          "moduleTestStartDate": "2024-11-21T00:00:00Z",
          "moduleTestEndDate": "2024-12-01T23:59:00Z",
          "moduleTestOrder": null,
          "delete": false,
          "updateAttempts": false
        }
      ]
    },
    {
      "moduleId": null,
      "moduleExternalId": "my-module-1002",
      "moduleTitle": "Module 2",
      "moduleOrder": 2,
      "moduleTests": [
        {
          "moduleTestId": "ed382660-dedf-49db-b192-8e0cdf586ae9",
          "testId": "f70a30c7-8173-4ebc-8b03-dfd141082522",
          "moduleTestMaxAttempts": null,
          "moduleTestPassingPercentage": null,
          "moduleTestStartDate": null,
          "moduleTestEndDate": null,
          "moduleTestOrder": null,
          "delete": false,
          "updateAttempts": false
        }
      ]
    }
  ]
}
POST https://api.startexam.com/v1/program HTTP/1.1
Host: api.startexam.com
Accept: application/json; charset=utf-8
Authorization: SharedKey 99:f52JP7GQd0xqrBzMO1NWTNVGzLENymgdUXu/Ie++NX4=
Content-Type: application/json; charset=utf-8
Content-Length: 950
Date: Thu, 21 Nov 2024 06:47:35 GMT

{
  "programId": null,
  "programExternalId": "my-program-555",
  "projectId": "56675cff-41ea-4b55-be9c-fd13db8f7e92",
  "centerId": "601bc3b6-c930-4dd8-b637-a9cd7618fea2",
  "folderTitle": "My Api Programs",
  "programTitle": "Program 2024. Knowledge check",
  "programStatus": "active",
  "programIsManual": true,
  "modules": [
    {
      "moduleId": null,
      "moduleExternalId": "my-module-1001",
      "moduleTitle": "Module 1 (updated)",
      "moduleOrder": 1,
      "moduleTests": [
        {
          "moduleTestId": "7a57b73a-d2b4-44f8-86b9-8b9ffc3c8d08",
          "testId": "4955f4ef-cd1c-4f15-8245-a4c9202b9525",
          "moduleTestMaxAttempts": 4,
          "moduleTestPassingPercentage": 65,
          "moduleTestStartDate": "2024-11-21T00:00:00Z",
          "moduleTestEndDate": "2024-12-01T23:59:00Z",
          "moduleTestOrder": null,
          "delete": false,
          "updateAttempts": true
        }
      ]
    }
  ]
}
POST https://api.startexam.com/v1/program HTTP/1.1
Host: api.startexam.com
Accept: application/json; charset=utf-8
Authorization: SharedKey 99:f52JP7GQd0xqrBzMO1NWTNVGzLENymgdUXu/Ie++NX4=
Content-Type: application/json; charset=utf-8
Content-Length: 344
Date: Thu, 21 Nov 2024 06:47:35 GMT

{
  "programId": null,
  "programExternalId": "my-program-555",
  "projectId": "56675cff-41ea-4b55-be9c-fd13db8f7e92",
  "centerId": "601bc3b6-c930-4dd8-b637-a9cd7618fea2",
  "folderTitle": "My Api Programs",
  "programTitle": "Program 2024. Knowledge check (updated)",
  "programStatus": "deleted",
  "programIsManual": true,
  "modules": []
}

Date and Authorization headers are constructed in the standard way.

Response Information

HTTP status code

200 OK, 400 Bad Request, etc. according the response processing guide.

Content-Type

Json.

Content

Method returns operation results:

  • ProgramResult - created or updated.
  • ModulesCreated - number of created modules.
  • ModulesUpdated - number of updated modules.
  • ModulesDeleted - number of deleted modules.
  • ModuleTestsCreated - number of created module tests.
  • ModuleTestsUpdated - number of updated module tests.
  • ModuleTestsDeleted - number of deleted module tests.
  • AttemptsCreated - number of created attempts.
  • AttemptsUpdated - number of updated attempts.
  • AttemptsDeleted - number of deleted attempts.

Response Example

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 254

{
  "programResult": "created",
  "modulesCreated": 2,
  "modulesUpdated": 0,
  "modulesDeleted": 0,
  "moduleTestsCreated": 2,
  "moduleTestsUpdated": 0,
  "moduleTestsDeleted": 0,
  "attemptsCreated": 0,
  "attemptsUpdated": 0,
  "attemptsDeleted": 0
}

Try Method