Create.Resource
This type of message will create a bookable resource. All resources are set-up by administrators and are associated with a valid organisation which are of a type Site or School.
Actions
This type of message will create a resource. Each resource should have a unique SynchKey associated with it up to the size of 128 characters. If no SyncKey is provided, then one is automatically generated for it.
An organisation must exist in itslearning where this resource will be created. Either an OrganisationId or OrganisationSyncKey needs to be provided and it should be of the type Site or School. Any other type of organisation is invalid and will generate an error message.
A UserId or UserSyncKey needs to be specified which identifies the user who created the resource.
Screenshots
Input
Name | Description | Type | M/O |
Message Type | Text. "Create.Resource" | M | |
SiteId | Site where action will be executed | Int | O |
VendorId | VendorId which will be associated with created content | Text | O |
SyncKey | External SyncKey for the created content. | Text | O |
UserId | UserId of the creator | Integer | O/M |
UserSyncKey | User SyncKey of the creator | Text | O/M |
OrganisationID | ID of the organisation associated with the resource. | Integer | O/M |
OrganisationSyncKey | SyncKeyID of the organisation group associated with the resource. | Text | O/M |
Repeating Block | |||
Title | Title of the resource. | Text Follow same rules as UI | M |
ShortName | Short name of the resource. | Text Follow same rules as UI. | M |
Description | Short description of the resoruce | O | |
Repeating Block | |||
AvailableFor | Who is the resource available for? Limited to: | Text | O |
Output
Warning Status:
- Invalid format / parameters (different to specified schema). List these in the error
- Message contains duplicates for syncKeys: {0}. Make sure your syncKeys are globally unique.
- Organisation with specified OrganisationId/OrganisationSyncKey is not valid.
- Title must not be blank or contain invalid characters.
- Short Name must not be blank or contain invalid characters.
Best Practice for 3rd Parties:
- Resources are set-up by administrators and are associated with an organisation.
- Multiple resources can be added to a single organisation in a single call to <addmessage>. The limit is 100 resources within a call. We recomend that you add all the resorces (for one organisation) at time (instead of adding them one at once) in each call to the Migration Toolkit.
- Each time you upload a resource it must be associated with a single organisation. If a resource appears in multiuple organisations (e.g. a LCD projector) it must be added to each organisation separately.
- Resources can only be made available for Staff, Learners, Guest. If nothing is set, then by default it is set to Nobody.
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
=
"unbounded"
>
<
xs
:complexType>
<
xs
:simpleContent>
<
xs
:extension
base
=
"xs:string"
>
<
xs
:attribute
name
=
"ID"
type
=
"xs:ID"
use
=
"required"
/>
</
xs
:extension>
</
xs
:simpleContent>
</
xs
:complexType>
</
xs
:element>
</
xs
:sequence>
</
xs
:complexType>
</
xs
:element>
<
xs
:element
name
=
"CreateResource"
type
=
"CreateResourceType"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:complexType
name
=
"CreateResourceType"
>
<
xs
:sequence>
<
xs
:choice
minOccurs
=
"1"
maxOccurs
=
"1"
>
<
xs
:element
name
=
"OrganisationId"
type
=
"xs:integer"
/>
<
xs
:element
name
=
"OrganisationSyncKey"
type
=
"xs:string"
/>
</
xs
:choice>
<
xs
:choice
minOccurs
=
"1"
maxOccurs
=
"1"
>
<
xs
:element
name
=
"UserId"
type
=
"xs:integer"
/>
<
xs
:element
name
=
"UserSyncKey"
type
=
"xs:string"
/>
</
xs
:choice>
<
xs
:element
name
=
"Resources"
type
=
"ResourcesType"
minOccurs
=
"1"
maxOccurs
=
"1"
/>
</
xs
:sequence>
</
xs
:complexType>
<
xs
:complexType
name
=
"ResourcesType"
>
<
xs
:sequence>
<
xs
:element
name
=
"Resource"
minOccurs
=
"1"
maxOccurs
=
"100"
>
<
xs
:complexType>
<
xs
:sequence>
<
xs
:element
name
=
"Title"
type
=
"xs:string"
minOccurs
=
"1"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"ShortName"
type
=
"xs:string"
minOccurs
=
"1"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"Description"
type
=
"xs:string"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"AvailableForStaff"
type
=
"xs:boolean"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"AvailableForLearner"
type
=
"xs:boolean"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
<
xs
:element
name
=
"AvailableForGuest"
type
=
"xs:boolean"
minOccurs
=
"0"
maxOccurs
=
"1"
/>
</
xs
:sequence>
<
xs
:attribute
name
=
"SyncKeyRef"
type
=
"xs:IDREF"
use
=
"optional"
/>
</
xs
:complexType>
</
xs
:element>
</
xs
:sequence>
</
xs
:complexType>
</
xs
:schema>
Message content example
<
Message
xmlns
=
"urn:message-schema"
>
<
SyncKeys
>
<
SyncKey
ID
=
"ID1"
>1234567</
SyncKey
>
<
SyncKey
ID
=
"ID2"
>2234567</
SyncKey
>
</
SyncKeys
>
<
CreateResource
>
<
OrganisationId
>4</
OrganisationId
>
<
UserId
>1</
UserId
>
<
Resources
>
<
Resource
SyncKeyRef
=
"ID1"
>
<
Title
>Skype Room</
Title
>
<
ShortName
>SKYPE</
ShortName
>
<
AvailableForStaff
>true</
AvailableForStaff
>
<
AvailableForLearner
>true</
AvailableForLearner
>
<
AvailableForGuest
>true</
AvailableForGuest
>
</
Resource
>
<
Resource
SyncKeyRef
=
"ID2"
>
<
Title
>Meeting Room 1</
Title
>
<
ShortName
>MR1</
ShortName
>
<
Description
>Large meeting rooms</
Description
>
<
AvailableForStaff
>true</
AvailableForStaff
>
<
AvailableForGuest
>false</
AvailableForGuest
>
</
Resource
>
<
Resource
>
<
Title
>Meeting Room 2</
Title
>
<
ShortName
>MR2</
ShortName
>
<
Description
>Small meeting rooms</
Description
>
<
AvailableForStaff
>true</
AvailableForStaff
>
<
AvailableForGuest
>true</
AvailableForGuest
>
</
Resource
>
<
Resource
>
<
Title
>External Room</
Title
>
<
ShortName
>Ex1</
ShortName
>
</
Resource
>
</
Resources
>
</
CreateResource
>
</
Message
>