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.
  • FolderTitle - name of the program folder. Max length: 150 symbols. 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: Mon, 21 Oct 2019 08:42:30 GMT

{
  "programId": null,
  "programExternalId": "my-program-555",
  "projectId": "6fc13915-49be-4d1e-b45d-f6b7f4cdcd2d",
  "centerId": "3ba5f91d-29e9-407c-bd83-a24b5eaa1e78",
  "folderTitle": "My Api Programs",
  "programTitle": "Program 2019. Knowledge check",
  "programStatus": "active",
  "programIsManual": true,
  "modules": [
    {
      "moduleId": null,
      "moduleExternalId": "my-module-1001",
      "moduleTitle": "Module 1",
      "moduleOrder": 1,
      "moduleTests": [
        {
          "moduleTestId": "92f4292a-a5b4-4b73-9b44-b036d15cd132",
          "testId": "7a424fce-9ce6-4667-a877-c5a1f51addac",
          "moduleTestMaxAttempts": 3,
          "moduleTestPassingPercentage": 70,
          "moduleTestStartDate": "2019-10-21T00:00:00Z",
          "moduleTestEndDate": "2019-10-31T23:59:00Z",
          "moduleTestOrder": null,
          "delete": false,
          "updateAttempts": false
        }
      ]
    },
    {
      "moduleId": null,
      "moduleExternalId": "my-module-1002",
      "moduleTitle": "Module 2",
      "moduleOrder": 2,
      "moduleTests": [
        {
          "moduleTestId": "3f82d8cb-a629-469c-baf1-16b311646eaf",
          "testId": "ff278959-d9cc-4535-9b43-0d3dde7ae5ab",
          "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: Mon, 21 Oct 2019 08:42:30 GMT

{
  "programId": null,
  "programExternalId": "my-program-555",
  "projectId": "6fc13915-49be-4d1e-b45d-f6b7f4cdcd2d",
  "centerId": "3ba5f91d-29e9-407c-bd83-a24b5eaa1e78",
  "folderTitle": "My Api Programs",
  "programTitle": "Program 2019. Knowledge check",
  "programStatus": "active",
  "programIsManual": true,
  "modules": [
    {
      "moduleId": null,
      "moduleExternalId": "my-module-1001",
      "moduleTitle": "Module 1 (updated)",
      "moduleOrder": 1,
      "moduleTests": [
        {
          "moduleTestId": "92f4292a-a5b4-4b73-9b44-b036d15cd132",
          "testId": "7a424fce-9ce6-4667-a877-c5a1f51addac",
          "moduleTestMaxAttempts": 4,
          "moduleTestPassingPercentage": 65,
          "moduleTestStartDate": "2019-10-21T00:00:00Z",
          "moduleTestEndDate": "2019-10-31T23: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: Mon, 21 Oct 2019 08:42:30 GMT

{
  "programId": null,
  "programExternalId": "my-program-555",
  "projectId": "6fc13915-49be-4d1e-b45d-f6b7f4cdcd2d",
  "centerId": "3ba5f91d-29e9-407c-bd83-a24b5eaa1e78",
  "folderTitle": "My Api Programs",
  "programTitle": "Program 2019. 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: 265

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

Try Method