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: Fri, 29 Mar 2024 15:40:05 GMT

{
  "programId": null,
  "programExternalId": "my-program-555",
  "projectId": "de4c0c85-5fc0-45dc-8874-464f8b0b4d22",
  "centerId": "1b6949a4-4101-4104-9708-793df2c700e8",
  "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": "00e28679-e45b-4836-8986-9b80625927e5",
          "testId": "fa5b1046-3758-4ead-bd8f-0551f6ddb4ac",
          "moduleTestMaxAttempts": 3,
          "moduleTestPassingPercentage": 70,
          "moduleTestStartDate": "2024-03-29T00:00:00Z",
          "moduleTestEndDate": "2024-04-08T23:59:00Z",
          "moduleTestOrder": null,
          "delete": false,
          "updateAttempts": false
        }
      ]
    },
    {
      "moduleId": null,
      "moduleExternalId": "my-module-1002",
      "moduleTitle": "Module 2",
      "moduleOrder": 2,
      "moduleTests": [
        {
          "moduleTestId": "7fcc4343-0459-43d5-88d5-3fe417b26f70",
          "testId": "0af1c3ad-91c8-40f9-8c42-754a74fe3dc2",
          "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: Fri, 29 Mar 2024 15:40:05 GMT

{
  "programId": null,
  "programExternalId": "my-program-555",
  "projectId": "de4c0c85-5fc0-45dc-8874-464f8b0b4d22",
  "centerId": "1b6949a4-4101-4104-9708-793df2c700e8",
  "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": "00e28679-e45b-4836-8986-9b80625927e5",
          "testId": "fa5b1046-3758-4ead-bd8f-0551f6ddb4ac",
          "moduleTestMaxAttempts": 4,
          "moduleTestPassingPercentage": 65,
          "moduleTestStartDate": "2024-03-29T00:00:00Z",
          "moduleTestEndDate": "2024-04-08T23: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: Fri, 29 Mar 2024 15:40:05 GMT

{
  "programId": null,
  "programExternalId": "my-program-555",
  "projectId": "de4c0c85-5fc0-45dc-8874-464f8b0b4d22",
  "centerId": "1b6949a4-4101-4104-9708-793df2c700e8",
  "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": "updated",
  "modulesCreated": 0,
  "modulesUpdated": 2,
  "modulesDeleted": 0,
  "moduleTestsCreated": 0,
  "moduleTestsUpdated": 2,
  "moduleTestsDeleted": 0,
  "attemptsCreated": 0,
  "attemptsUpdated": 0,
  "attemptsDeleted": 0
}

Try Method