File

Input parameters

Message

Name

Description

Type

M/O

Description

Description shown for the file

Text

O

FileContentType

Mime type of file, will try to determine from fileName if not provided

Text

O

FileLocation

Location of the file (return value from the FileStreamService

Text

M

FileName

Name of the file

Text

M

Content example

Create Extension Instance content
<FileContent>
<Description>This is a file</Description>
<FileContentType>image/jpeg</FileContentType>
<FileLocation>0f6ac961-a93f-4cea-b4ff-c93a92cb2ddd</FileLocation>
<FileName>Jellyfish.jpg</FileName>
</FileContent>


Full request example

<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>9</CourseId>
<UserId>1</UserId>
<Title>This is a 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>
]]></its:Data>
<!--Optional:-->
<its:Type>37</its:Type>
</tem:dataMessage>
</tem:AddMessage>
</soapenv:Body>
</soapenv:Envelope>

Errors

  • Invalid content: both file id and file name need to be specified

  • Invalid content: the length of the file name is too long (the maximum length is 155 characters).

  • File upload has failed: FileId cannot be reused.

  • File upload has failed: {Error}

  • File upload error: unknown error occured