Create.Extension.Instance
Currently we only support creating Page, File, Link, LTI (Learning Tool Interoperability), Assignment, Survey and Test Tool (Test 3.0) through this method
This method will create an extension element in a given location and populate it with content. For course the element is created under a specified parent folder in the course. If parent folder is not specified, then by default it will be placed under the course root folder.
Action
This type of message will create an extension element in a specified location. The element can be added to the course root folder or another folder within a course. Each page element should have a unique SyncKey associated with it up to the size of 128 characters, if no SyncKey is provided one will be generated.
Input Parameters
Message | |||
Name | Description | Type | M/O |
SyncKey | External SyncKey for the created content. | Text | O |
SiteId | Site where action will be executed | Integer | O |
VendorId | VendorId which will be associated with created content | Text | O |
Location | Location where the extension should be created, either Course or Library. | Text
| M |
ExtensionId | Id of the extension | Integer | M |
CourseId | Id of the course where the element is to be created. | Integer | O/M |
CourseSyncKey | SyncKey of the course where the element is to be created. | Text | O/M |
ParentID | ID of the folder where the element is to be created. If not specified then create in root. This is a ID of a previously created folder int he course. | Integer | O |
ParentSyncKey | SyncKey of the folder where the element is to be created. If not specified then create in root. This is a SyncKey of a previously created folder int he course. | Text | O |
UserId | UserId of the creator. | Integer | O/M |
UserSyncKey | User SyncKey of the creator. | Text | O/M |
Title | ExtensionInstance title in itslearning | Text. Must not be blank. Must follow same rules as UI | M |
Metadata | Metadata information for in My Library | ComplexType - MetaDataType | O |
Sharing | Sharing information | ComplexType - SharingType | O |
Content | Page content in XML format corresponding to the extension format. Specific extension format can be retrieved with the GetExtensions method. Possible content: | XML | M |
DisallowModification | Defines if the user is allowed to make their own version of the resource. If the value is not specified it considers as false. | Boolean | O |
ElementProperties | Element properties | ComplexType - ElementPropertiesType | O |
Notes:
MetadataType | |||
Name | Description | Type | M/O |
Description | Text description | Text | O |
Language | Language in culture format e.g. en-US | Text | O |
Format | Format | Text
| O |
Keywords | Complex type - an array of KeywordType | O | |
LearningObjectives | Complex type - an array of LearningObjectivesType | O | |
IntendedEndUserRole | The intended user of the content. If this is not specified then the content is assumed to be suitable for all user groups. Vocab is based on IMS LOM roles standard. IMSGLC_CC_Rolesv1p1 vocab Example: <IntendedEndUserRole>Learner Instructor</IntendedEndUserRole> | Text (One or more)
| O |
Grade | The grade level (or grade level range) of the materials. In LangString format (values separated with spaces). Allowed values: K, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 | Text | O |
Duration (note: at this moment this is not used) | The Duration provides the length of the period according to [ISO8601, 00], for example P3M for three months, PT3m58s for three minutes 58 seconds. A optional description of the Duration can be provided for periods that are not well described by this scheme, for example "about half an hour". The description is given as a LangString. | Complex type - DurationType | O |
ThumbnailUrl | Url of the thumbnail associated with the learning object | Text | O |
EducationalIntent | The educational intent of the resource. | Text (One or more)
| O |
HasFlashContent | Set to true to indicate that the resource has Adobe Flash content | Boolean | O |
IntendedAge | The ages that the material is intended for, In LangString format (values separated with spaces). Allowed values: 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 | Text | O |
Publisher | The name of the publisher | Text | O |
ReadingGradeLevel | The reading grade level (or grade level range) of the materials. Either a single value (X) or a range (X-Y), where X and Y are one of: K, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 | Text | O |
KnovationReadabilityScore | The reading grade level (or grade level range) of the materials. Either a single value (X) or a range (X-Y), where X and Y are one of: 1, 2, 3, 4, 5 NOTE: This can only be set by the content vendor "Knovation" | Text | O |
LexileScore | The reading grade level (or grade level range) of the materials. Either a single value (X) or a range (X-Y), where X and Y are valid lexile scores (for example 250L or 1440L) | Text | O |
Subjects | Subjects of the materials. These are mapped to aliases that are created inside itslearning. | Complex type - an array of SubjectType | O |
KeywordType | |||
Name | Description | Type | M/O |
Keyword | The keyword Min. length 3 char, max. length 200 char | Text | O |
LearningObjectivesType | |||
Name | Description | Type | M/O |
LearningObjective | Complex type - an array of LearningObjectiveType | O |
LearningObjectiveType | |||
Name | Description | Type | M/O |
LearningObjectiveId | The learning objective ID | Text | O |
SharingType | |||
Name | Description | Type | M/O |
Scope | Scope | Text
| O |
OrganisationSyncKey | SyncKey of the organisation | Text | O |
Sites | Array of sites when sharing scope is custom | Complex type - SitesType | O |
SitesType | |||
Name | Description | Type | M/O |
Site | Site where content will be shared | Complex type - array of SiteType | O |
ElementPropertiesType | |||
---|---|---|---|
Name | Description | Type | M/O |
Active | Whether extension instance is Active (available for all students) | Boolean | O |
AssessmentScale | Assessment scale ID | Integer | O |
MaxScore | This is the max score value, if element is using score as assessment type. Max score should be a valid positive number in range between 1 and 99999. If the value is less than zero or greater than 99999 then "No assessment" is used. If the customer has setting "Use score" set to "Off" then it is assumed as "No assessment" and warning returned. NOTE: You are not allowed to enter both Assessment and MaxScore. | Double | O |
DurationType | |||
---|---|---|---|
Name | Description | Type | M/O |
DurationValue | The Duration provides the length of the period according to [ISO8601, 00], for example P3M for three months, PT3m58s for three minutes 58 seconds. | Text | M |
Description | A optional description of the Duration can be provided for periods that are not well described by this scheme, for example "about half an hour". The description is given as a LangString. | Text | O |
SubjectType | |||
Name | Description | Type | M/O |
Subject | Subject name / alias | Text | O |
Notes:
Scenario
In order to create an extension element, a user needs to add a message corresponding to Create.ExtensionInstance.
Result of the message processing can be acquired using GetMessageResult method with message identifier as an input parameter.
Message schema
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
xs
:schema
xmlns:xs
=
"http://www.w3.org/2001/XMLSchema"
xmlns
=
"urn:message-schema"
elementFormDefault
=
"qualified"
targetNamespace
=
"urn:message-schema"
>
<
xs
:element
name
=
"Message"
type
=
"MessageType"
/>
<
xs
:complexType
name
=
"MessageType"
>
<
xs
:sequence>
<
xs
:element
name
=
"SyncKeys"
minOccurs
=
"0"
maxOccurs
=
"1"
>
<
xs
:complexType>
<
xs
:sequence>
<
xs
:element
name
=
"SyncKey"
minOccurs
=
"0"
maxOccurs
=
"1"
type
=
"xs:string"
/>
</
xs
:sequence>
</
xs
:complexType>
</
xs
:element>
<
xs
:element
name
=
"SiteId"
minOccurs
=
"0"
maxOccurs
=
"1"
type
=
"xs:int"
/>
<
xs
:element
name
=
"VendorId"
minOccurs
=
"0"
maxOccurs
=
"1"
>
<
xs
:simpleType>
<
xs
:restriction
base
=
"xs:string"
>
<
xs
:minLength
value
=
"1"
/>
<
xs
:maxLength
value
=
"36"
/>
</
xs
:restriction>
</
xs
:simpleType>
</
xs
:element>
<
xs
:element
name
=
"CreateExtensionInstance"
type
=
"CreateExtensionInstanceElementType"
minOccurs
=
"1"
maxOccurs
=
"1"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:complexType
name
=
"CreateExtensionInstanceElementType"
>
<
xs
:sequence>
<
xs
:element
name
=
"Location"
type
=
"LocationEnum"
minOccurs
=
"1"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"ExtensionId"
type
=
"xs:int"
minOccurs
=
"1"
maxOccurs
=
"1"
/>
<
xs
:choice
minOccurs
=
"0"
maxOccurs
=
"1"
>
<
xs
:element
name
=
"CourseId"
type
=
"xs:int"
/>
<
xs
:element
name
=
"CourseSyncKey"
type
=
"xs:string"
/>
</
xs
:choice>
<
xs
:element
name
=
"ParentSyncKey"
minOccurs
=
"0"
maxOccurs
=
"1"
type
=
"xs:string"
/>
<
xs
:choice
minOccurs
=
"1"
maxOccurs
=
"1"
>
<
xs
:element
name
=
"UserId"
type
=
"xs:int"
/>
<
xs
:element
name
=
"UserSyncKey"
type
=
"xs:string"
/>
</
xs
:choice>
<
xs
:element
name
=
"Title"
minOccurs
=
"1"
maxOccurs
=
"1"
>
<
xs
:simpleType>
<
xs
:restriction
base
=
"xs:string"
>
<
xs
:minLength
value
=
"1"
/>
<
xs
:maxLength
value
=
"255"
/>
</
xs
:restriction>
</
xs
:simpleType>
</
xs
:element>
<
xs
:element
name
=
"Metadata"
type
=
"MetadataType"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Sharing"
type
=
"SharingType"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Content"
type
=
"ContentType"
minOccurs
=
"1"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"DisallowModification"
type
=
"xs:boolean"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"ElementProperties"
type
=
"ElementPropertiesType"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:simpleType
name
=
"LocationEnum"
>
<
xs
:restriction
base
=
"xs:string"
>
<
xs
:enumeration
value
=
"Course"
/>
<
xs
:enumeration
value
=
"Library"
/>
</
xs
:restriction>
</
xs
:simpleType>
<
xs
:simpleType
name
=
"FormatEnum"
>
<
xs
:restriction
base
=
"xs:string"
>
<
xs
:enumeration
value
=
"Any"
/>
<
xs
:enumeration
value
=
"Audio"
/>
<
xs
:enumeration
value
=
"Image"
/>
<
xs
:enumeration
value
=
"Interactive"
/>
<
xs
:enumeration
value
=
"Text"
/>
<
xs
:enumeration
value
=
"Video"
/>
</
xs
:restriction>
</
xs
:simpleType>
<
xs
:simpleType
name
=
"ScopeEnum"
>
<
xs
:restriction
base
=
"xs:string"
>
<
xs
:enumeration
value
=
"Private"
/>
<
xs
:enumeration
value
=
"School"
/>
<
xs
:enumeration
value
=
"Site"
/>
<
xs
:enumeration
value
=
"Community"
/>
<
xs
:enumeration
value
=
"Custom"
/>
</
xs
:restriction>
</
xs
:simpleType>
<
xs
:simpleType
name
=
"EducationalIntentEnum"
>
<
xs
:list>
<
xs
:simpleType>
<
xs
:restriction
base
=
"xs:string"
>
<
xs
:enumeration
value
=
"Practice"
/>
<
xs
:enumeration
value
=
"Instructional"
/>
<
xs
:enumeration
value
=
"ProfessionalDevelopment"
/>
<
xs
:enumeration
value
=
"Assessment"
/>
<
xs
:enumeration
value
=
"Activity"
/>
</
xs
:restriction>
</
xs
:simpleType>
</
xs
:list>
</
xs
:simpleType>
<
xs
:complexType
name
=
"MetadataType"
>
<
xs
:sequence>
<
xs
:element
name
=
"Description"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Language"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Format"
type
=
"FormatEnum"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Keywords"
type
=
"KeywordsType"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"LearningObjectives"
type
=
"LearningObjectivesType"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"IntendedEndUserRole"
type
=
"IntendedEndUserRoleEnum"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Grade"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Duration"
type
=
"DurationType"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"ThumbnailUrl"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"EducationalIntent"
type
=
"EducationalIntentEnum"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"HasFlashContent"
type
=
"xs:boolean"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"IntendedAge"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Publisher"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"ReadingGradeLevel"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"KnovationReadabilityScore"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"LexileScore"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Subjects"
type
=
"SubjectsType"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:complexType
name
=
"SharingType"
>
<
xs
:sequence>
<
xs
:element
name
=
"Scope"
type
=
"ScopeEnum"
minOccurs
=
"0"
maxOccurs
=
"1"
default
=
"Private"
/>
<
xs
:element
name
=
"OrganisationSyncKey"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Sites"
type
=
"SitesType"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:complexType
name
=
"SitesType"
>
<
xs
:sequence>
<
xs
:element
name
=
"Site"
minOccurs
=
"0"
maxOccurs
=
"unbounded"
>
<
xs
:complexType>
<
xs
:sequence>
<
xs
:element
name
=
"OrganisationSyncKey"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"unbounded"
/>
</
xs
:sequence>
<
xs
:attribute
name
=
"ID"
type
=
"xs:int"
use
=
"required"
/>
</
xs
:complexType>
</
xs
:element>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:complexType
name
=
"KeywordsType"
>
<
xs
:sequence>
<
xs
:element
name
=
"Keyword"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"unbounded"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:complexType
name
=
"LearningObjectivesType"
>
<
xs
:sequence>
<
xs
:element
name
=
"LearningObjective"
type
=
"LearningObjectiveType"
minOccurs
=
"0"
maxOccurs
=
"unbounded"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:complexType
name
=
"LearningObjectiveType"
>
<
xs
:sequence>
<
xs
:element
name
=
"LearningObjectiveId"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:simpleType
name
=
"IntendedEndUserRoleEnum"
>
<
xs
:list>
<
xs
:simpleType>
<
xs
:restriction
base
=
"xs:string"
>
<
xs
:enumeration
value
=
"Learner"
/>
<
xs
:enumeration
value
=
"Instructor"
/>
<
xs
:enumeration
value
=
"Mentor"
/>
</
xs
:restriction>
</
xs
:simpleType>
</
xs
:list>
</
xs
:simpleType>
<
xs
:complexType
name
=
"DurationType"
>
<
xs
:sequence>
<
xs
:element
name
=
"DurationValue"
type
=
"xs:string"
minOccurs
=
"1"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Description"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:complexType
name
=
"SubjectsType"
>
<
xs
:sequence>
<
xs
:element
name
=
"Subject"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"unbounded"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:complexType
name
=
"ContentType"
>
<
xs
:sequence>
<
xs
:any
minOccurs
=
"0"
processContents
=
"skip"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:complexType
name
=
"ElementPropertiesType"
>
<
xs
:sequence>
<
xs
:element
name
=
"Active"
type
=
"xs:boolean"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"AssessmentScale"
type
=
"xs:int"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"MaxScore"
type
=
"xs:double"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
</
xs
:sequence>
</
xs
:complexType>
</
xs
:schema>
Message content example (File extension. Destination: course)
<
Message
xmlns
=
"urn:message-schema"
>
<
CreateExtensionInstance
>
<
Location
>Course</
Location
>
<
ExtensionId
>5009</
ExtensionId
>
<
CourseId
>1</
CourseId
>
<
UserId
>6</
UserId
>
<
Title
>My Jellyfish file</
Title
>
<
Content
>
<
FileContent
>
<
Description
>This is a file</
Description
>
<
FileContentType
>image/jpeg</
FileContentType
>
<
FileLocation
>0f6ac961-a93f-4cea-b4ff-c93a92cb2ddd</
FileLocation
>
<
FileName
>Jellyfish.jpg</
FileName
>
</
FileContent
>
</
Content
>
<
ElementProperties
>
<
Active
>true</
Active
>
</
ElementProperties
>
</
CreateExtensionInstance
>
</
Message
>
Message content example (Link extension. Destination: course)
<
Message
xmlns
=
"urn:message-schema"
>
<
CreateExtensionInstance
>
<
Location
>Course</
Location
>
<
ExtensionId
>5010</
ExtensionId
>
<
CourseId
>1</
CourseId
>
<
UserId
>6</
UserId
>
<
Title
>Link to a website</
Title
>
<
Content
>
<
LinkContent
>
<
Description
>This is a link to Google</
Description
>
<
EmbedLinkTarget
>true</
EmbedLinkTarget
>
<
Link
>
http://www.google.com
</
Link
>
</
LinkContent
>
</
Content
>
<
ElementProperties
>
<
Active
>true</
Active
>
</
ElementProperties
>
</
CreateExtensionInstance
>
</
Message
>
Message content example (LTI extension. Destination: course)
<
Message
xmlns
=
"urn:message-schema"
>
<
CreateExtensionInstance
>
<
Location
>Course</
Location
>
<
ExtensionId
>5003</
ExtensionId
>
<
CourseId
>1</
CourseId
>
<
UserId
>6</
UserId
>
<
Title
>Link to a website</
Title
>
<
Content
>
<
LtiContent
>
<
XmlConfiguration
>
<
Url
>
http://www.edu-apps.org/tools/youtube/config.xml
</
Url
>
</
XmlConfiguration
>
<
Description
>youtube LTI</
Description
>
<
OpenIn
>ExistingWindow</
OpenIn
>
</
LtiContent
>
</
Content
>
<
ElementProperties
>
<
Active
>true</
Active
>
<
AssessmentScale
>2</
AssessmentScale
>
</
ElementProperties
>
</
CreateExtensionInstance
>
</
Message
>
Message content example (Test 3.0 extension. Destination: Course)
<
Message
xmlns
=
"urn:message-schema"
>
<
CreateExtensionInstance
>
<
Location
>Course</
Location
>
<
ExtensionId
>5002</
ExtensionId
>
<
CourseId
>7</
CourseId
>
<
UserId
>1</
UserId
>
<
Title
>Test 3.0 by org api</
Title
>
<
Content
>
<
TestContent
>
<
Description
>Hello word!</
Description
>
</
TestContent
>
</
Content
>
</
CreateExtensionInstance
>
</
Message
>
Message content example (Survey extension. Destination: Course)
<
Message
xmlns
=
"urn:message-schema"
>
<
CreateExtensionInstance
>
<
Location
>Course</
Location
>
<
ExtensionId
>5050</
ExtensionId
>
<
CourseId
>9</
CourseId
>
<
UserId
>1</
UserId
>
<
Title
>This is a survey</
Title
>
<
Content
>
<
JsonContent
>
{
"Description": "This is survey description",
"RespondentType": "NonAnonymous"
}
</
JsonContent
>
</
Content
>
<
ElementProperties
>
<
Active
>true</
Active
>
</
ElementProperties
>
</
CreateExtensionInstance
>
</
Message
>
Message content example (Page extension. Destination: My Library)
<
Message
xmlns
=
"urn:message-schema"
>
<
CreateExtensionInstance
>
<
Location
>Library</
Location
>
<
ExtensionId
>5</
ExtensionId
>
<
CourseId
>87</
CourseId
>
<
UserId
>1</
UserId
>
<
Title
>Page with metadata</
Title
>
<
Metadata
>
<
Description
>This is my new description for this extension instance</
Description
>
<
Language
>en-US</
Language
>
<
Format
>Interactive</
Format
>
<
Keywords
>
<
Keyword
>Keyword1</
Keyword
>
<
Keyword
>Keyword2</
Keyword
>
</
Keywords
>
<
LearningObjectives
>
<
LearningObjective
>
<
LearningObjectiveId
>ABC</
LearningObjectiveId
>
</
LearningObjective
>
</
LearningObjectives
>
</
Metadata
>
<
Sharing
>
<
Scope
>School</
Scope
>
<
OrganisationSyncKey
>SchoolA</
OrganisationSyncKey
>
</
Sharing
>
<
Content
>
<
PageContent
>
<
ContentBlockSets
>
<
ContentBlockSet
>
<
ContentBlockImages
>
<
Title
>Desert and tulips images</
Title
>
<
Images
>
<
BlockImage
>
<
Title
>Desert</
Title
>
<
File
>
<
Id
>1</
Id
>
</
File
>
</
BlockImage
>
<
BlockImage
>
<
Title
>Tulips</
Title
>
<
File
>
<
Id
>2</
Id
>
</
File
>
</
BlockImage
>
</
Images
>
</
ContentBlockImages
>
</
ContentBlockSet
>
</
ContentBlockSets
>
</
PageContent
>
</
Content
>
</
CreateExtensionInstance
>
</
Message
>
Message content example (Assignment extension. Destination: My Library)
<
Message
xmlns
=
"urn:message-schema"
>
<
CreateExtensionInstance
>
<
Location
>Library</
Location
>
<
ExtensionId
>5006</
ExtensionId
>
<
CourseId
>6</
CourseId
>
<
UserId
>1</
UserId
>
<
Title
>Assignment from Org API</
Title
>
<
Content
>
<
AssignmentContent
>
<
Files
>
<
File
>
<
Id
>90e49b77-2832-4966-98cb-4a746e501a31</
Id
>
<
Name
>image.jpg</
Name
>
</
File
>
</
Files
>
<
Text
>Hello wordl!!!</
Text
>
</
AssignmentContent
>
</
Content
>
</
CreateExtensionInstance
>
</
Message
>
Message content example (Assignment extension. Destination: Course)
<
Message
xmlns
=
"urn:message-schema"
>
<
CreateExtensionInstance
>
<
Location
>Course</
Location
>
<
ExtensionId
>5006</
ExtensionId
>
<
CourseId
>6</
CourseId
>
<
UserId
>1</
UserId
>
<
Title
>Assignment from Org API</
Title
>
<
Content
>
<
AssignmentContent
>
<
Text
>This is an assignment with MaxScore</
Text
>
</
AssignmentContent
>
</
Content
>
<
ElementProperties
>
<
MaxScore
>100</
MaxScore
>
</
ElementProperties
>
</
CreateExtensionInstance
>
</
Message
>
Full request example - File in course
<
soapenv
:Envelope
xmlns:soapenv
=
"http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem
=
"http://tempuri.org/"
xmlns:its
=
"http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Services.Entities"
>
<
soapenv
:Header/>
<
soapenv
:Body>
<
tem
:AddMessage>
<!--Optional:-->
<
tem
:dataMessage>
<!--Optional:-->
<
its
:Data>
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<Message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:message-schema">
<CreateExtensionInstance>
<Location>Course</Location>
<ExtensionId>5009</ExtensionId>
<CourseId>2</CourseId>
<UserId>1</UserId>
<Title>FileContent</Title>
<Content>
<FileContent>
<Description>This is Description</Description>
<FileContentType>image/jpeg</FileContentType>
<FileLocation>162b718e-a8f7-4a71-b8aa-527523c52b4b</FileLocation>
<FileName>sheep.jpg</FileName>
</FileContent>
</Content>
<ElementProperties>
<Active>false</Active>
</ElementProperties>
</CreateExtensionInstance>
</Message>
]]>
</
its
:Data>
<!--Optional:-->
<
its
:Type>37</
its
:Type>
</
tem
:dataMessage>
</
tem
:AddMessage>
</
soapenv
:Body>
</
soapenv
:Envelope>
Full request example - Link in course
<
soapenv
:Envelope
xmlns:soapenv
=
"http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem
=
"http://tempuri.org/"
xmlns:its
=
"http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Services.Entities"
>
<
soapenv
:Header/>
<
soapenv
:Body>
<
tem
:AddMessage>
<
tem
:dataMessage>
<
its
:Data>
<![CDATA[
<Message xmlns="urn:message-schema">
<CreateExtensionInstance>
<Location>Course</Location>
<ExtensionId>5009</ExtensionId>
<CourseId>2</CourseId>
<UserId>2</UserId>
<Title>Create</Title>
<Content>
<LinkContent>
<Description>This is a link to Google</Description>
<EmbedLinkTarget>true</EmbedLinkTarget>
<Link>http://www.google.com</Link>
</LinkContent>
</Content>
<ElementProperties>
<Active>false</Active>
</ElementProperties>
</CreateExtensionInstance>
</Message>
]]>
</
its
:Data>
<
its
:Type>37</
its
:Type>
</
tem
:dataMessage>
</
tem
:AddMessage>
</
soapenv
:Body>
</
soapenv
:Envelope>
Full request example - Assignment in Library
<
soapenv
:Envelope
xmlns:soapenv
=
"http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem
=
"http://tempuri.org/"
xmlns:its
=
"http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Services.Entities"
>
<
soapenv
:Header/>
<
soapenv
:Body>
<
tem
:AddMessage>
<
tem
:dataMessage>
<
its
:Data>
<![CDATA[
<Message xmlns="urn:message-schema">
<CreateExtensionInstance>
<Location>Library</Location>
<ExtensionId>5006</ExtensionId>
<CourseId>6</CourseId>
<UserId>1</UserId>
<Title>Assignment from Org API</Title>
<Content>
<AssignmentContent>
<Text>Hello wordl!!!</Text>
</AssignmentContent>
</Content>
</CreateExtensionInstance>
</Message>
]]>
</
its
:Data>
<
its
:Type>37</
its
:Type>
</
tem
:dataMessage>
</
tem
:AddMessage>
</
soapenv
:Body>
</
soapenv
:Envelope>
Full request example - Test 3.0 in Course
<
soapenv
:Envelope
xmlns:soapenv
=
"http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem
=
"http://tempuri.org/"
xmlns:its
=
"http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Services.Entities"
>
<
soapenv
:Header/>
<
soapenv
:Body>
<
tem
:AddMessage>
<
tem
:dataMessage>
<
its
:Data>
<![CDATA[<?xml version="1.0" encoding="utf-16"?>
<Message xmlns="urn:message-schema">
<CreateExtensionInstance>
<Location>Course</Location>
<ExtensionId>5002</ExtensionId>
<CourseId>7</CourseId>
<UserId>1</UserId>
<Title>Test 3.0 by org api - image test 4</Title>
<Content>
<TestContent>
<Description>Hello word!</Description>
</TestContent>
</Content>
</CreateExtensionInstance>
</Message>
]]>
</
its
:Data>
<
its
:Type>37</
its
:Type>
</
tem
:dataMessage>
</
tem
:AddMessage>
</
soapenv
:Body>
</soapenv:Envelope
Note:
Please note, that message type identifiers are not consistent across environments.
Before you use any of the create.extension.instance method please run GetMessageTypes request to make sure you are using the correct ID.
Uploading files
Extensions like Test 3.0 and Assignment can be created with files as well. In order to generate a valid GUID you need to use BasicHttpBinding_IFileStreamService. Example request below (for Test 3.0):
<
soapenv
:Envelope
xmlns:soapenv
=
"http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem
=
"http://tempuri.org/"
>
<
soapenv
:Header>
<
tem
:Name>Match_11.zip</
tem
:Name>
<
tem
:ExtensionId>5002</
tem
:ExtensionId>
</
soapenv
:Header>
<
soapenv
:Body>
<
tem
:StreamMessage>
<
tem
:Content><
inc
:Include
href
=
"cid:Match_11.zip"
xmlns:inc
=
"http://www.w3.org/2004/08/xop/include"
/></
tem
:Content>
</
tem
:StreamMessage>
</
soapenv
:Body>
</
soapenv
:Envelope>
Make sure to attach a file before running this method.
Output
- If the extension was created successfully.
- Returns the Element ID (Instance Id for Library) and SyncKey of the element.
- Sharing can't be specified for course.
- Sharing Scope is not set to School, but still an Organisation SyncKey is given.
- Learning objective with UniqueId='{0}' is not in the learning objective repository
- Not all Intended age values are valid, value(s): {0} are skipped
- Not all Grade values are valid, value(s): {0} are skipped
- Subject with Alias='{0}' is not in the learning objective repository.
- Both AssessmentScale and MaxScore specified at the same time. Only one of them can be specified.
- Your settings don't allow you to use score as assessment alternative. Please contact your administrator. - "No Assessment" assumed.
- Max score should be a valid positive number in range between 1 and 99999 - "No Assessment" assumed.
- Failed to create the instance.
- Failure when processing CreateExtensionInstance.
- Language {language} is not supported.
- The given metadata was not valid.
- The given Organisation SyncKey is not valid.
- Your security settings don't allow you to perform that operation. No valid Organisation found for course - (Course Id {0}) {1}
Your security settings don't allow you to perform that operation. " +
"Please contact administration to grant you an access to {0} organisation.- The Instance is shared with a School, but no Organisation SyncKey is given.
- The given sharing data was not valid.
- Message must contain valid content xml.
- No valid extension id is given.
- Content xml does not adhere to the Xsd schema.
- Invalid user session
There was an error creating the new extension instance.
- An error has occured while setting the Metadata.
- An error has occured while setting the Sharing data
- Sharing error: Not all the Metadata required by the SharingRule for {sharing scope} is given, missing {list of missing metadata}.
- Can't impersonate siteaccess. Invalid siteaccess.
- Can't impersonate siteaccess. Invalid CustomerId.
- Can't impersonate siteaccess. Siteaccess connected to specific Site.
- Can't impersonate siteaccess. It's not permitted on provided Site.
- SiteAccess should be connected to Site or SiteId should be specified.
- ParentSyncKey/ParentId is not an element within the course.
- ParentSyncKey/ParentId is not a folder.
- Folder related to ParentSyncKey/ParentId has been deleted or removed.
- Message must contain valid ParentId.
Validation Rules
Before message is processed the processor will validate the message content and state of objects referred in it. These are validation rules:
- Input matches the schema above (content needs to match extension specific content schema).
- Check the SyncKey is unqiue.
- User must exist.
- User must not be external.
- User must not be deleted.
- When location is library, user must have access to my library functionality
- When location Course is provided, course id or course SyncKey must be provided.
- If specified: Course must exist.
- If specified: Course must not be external.
- If specified: Course must not be deleted.
- If specified: Course must not be archived.
- If specified: ParentId must be the ID of a folder within the course.
- If specified: ParentId must be a folder.
- If specified: ParentId must not be deleted.
- If specified: ParentSyncKey must be the SyncKey of a folder within the course.
- If specified: ParentSyncKey must be a folder.
- If specified: ParentSyncKey must not be deleted.
- If created in a course or shared within organisation: Consumer must have access to organisation where course is created..
- If sharing with site: Consumer must have access to site
- If sharing with school: OrganisationSyncKey must be provided
- If specified: Learning objective id must be in repository.
- If specified language does not match languages defined in platform.
- If specified validate sharing rules.
- If specified: Assessment scale must exist and belong to specified course.
If specified: Max score should be a valid positive number in range between 1 and 99999. If the value is less than zero or greater than 99999 then "No assessment" is used.
If specified: Max score value can be set only if the customer has setting "Use score" set to "On". In other case "Not assessment" assumed and warning created.
Warnings
- Sharing can't be specified for course instances (when Location is Course).
- OrganisationSyncKey is provided and Sharing scope is not School
Handling files within Page content blocks
For more details on how to handle file uploads, please see Handling rich content and files and FileStreamService.svc methods and messages, the supported file upload method(s) depends on the extension supporting it.