Edit Unit

Note:

  • You can modify one or more of the following items: unit name, description, or publication status. If none of name, content, or publishFlag are provided, an error Incomplete or Invalid Parameters will be returned.
  • When editing a unit, the name must be unique and not duplicate any existing units in the course.
  • Publishing a unit using this interface will not automatically publish the activities within that unit. To publish those activities, please call the Release Activity Interface.

URL

https://root_url/lms/unit/update

HTTP Request Methods

  • POST

coding Format

  • UTF-8

Request Data

Header Parameters

Key Required Type Description
X-EEO-SIGN Yes string Signature; see the rules here
X-EEO-UID Yes string Institution's SID
X-EEO-TS Yes string Timestamp

Body Parameters

key Required Type Description Rules Description
courseId Yes integer Class (Course) ID ID of class that the unit belongs to
unitId Yes integer Unit ID
name No string Unit Name Length must not exceed 50 characters. Note: The unit name must not duplicate any existing units in the course.
content No string Unit Description Not provided means no changes
publishFlag No integer Publication Status 0 = Draft, 2 = Published (Visible). Only supports changing from Draft to Published; reverse operation is not allowed.

Response Data

Parameter Name Type Example Value Description
code integer 1 Error code
msg string "Execution successful" Error message
data array [] Response array
 └ object Response object
  └ unitId integer 26020895 Unit ID

Sample

  • HTTP request
POST /lms/unit/update HTTP/1.1
Host: root_url
X-EEO-SIGN: a77fcc847b3704afde607bbd0c5231f4
X-EEO-UID: 409864
X-EEO-TS: 1722937832
Content-Type: application/json
Content-Length: 197

{
    "courseId": 414193,
    "unitId": 26020895,
    "name": "Edit Unit",
    "content": "Edit Unit Description",
    "publishFlag": 2
}
  • Shell cURL analog request instruction
curl -X POST \
     -H 'Host: root_url' \
     -H 'X-EEO-SIGN: a77fcc847b3704afde607bbd0c5231f4' \
     -H 'X-EEO-UID: 409864' \
     -H 'X-EEO-TS: 1722937832' \
     -H 'Content-Type: application/json' \
     -d '{"courseId": 414193, "unitId": 26020895, "name": "Edit Unit", "content": "Edit Unit Description", "publishFlag": 2}' \
     'https://root_url/lms/unit/update'

Response Sample(The normal return json packet example)

{
    "code": 1,
    "msg": "Execution successful",
    "data": {
        "unitId": 26020895
    }
}

Error Code Descriptions

Error Code Description
147 No information for this class
40004 Cannot change published unit back to draft
40020 Unit does not exist
50003 Duplicate unit name
101001001 Parameter error
101002005 Signature exception
101002006 Timestamp expired
101002008 Timestamp does not exist
121601020 Business parameter error
121601021 Class does not belong to your institution
121601022 It is not a standard class
121601023 This class has been dissolved and cannot be operated
121601030 Missing required parameters

results matching ""

    No results matching ""