POST restapi/personal/courses/{courseId}/folders/{folderId}/file/filerepo/v1?planId={planId}

Creates a file element in the course containing the file.

Returns HTTP status 403 not found, if the user don't have access to the course or folder.

Returns HTTP status 404 not found, if the course does not exist.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
courseId

The course identifier.

integer

Required

folderId

The folder identifier.

integer

Required

planId

If files are added to a plan, supply this parameter so learning objectives and visibility settings are inherited from the plan

integer

Default value is 0

Body Parameters

Information about file to create

Collection of Itslearning.Web.UI.Controls.Uploaders.Metadata.UploadMetadata
NameDescriptionTypeAdditional information
Id

globally unique identifier

None.

Name

string

None.

SourceType

Itslearning.FileRepo.Common.Models.SourceType

None.

MimeType

string

None.

OriginalFileId

string

None.

signedFileRepoId

string

None.

signature

string

None.

isTemplate

boolean

None.

customId

string

None.

Request Formats

application/json, text/json

Sample:
[
  {
    "id": "5840abc8-ab7a-4897-bde0-71b03b56d3df",
    "name": "sample string 1",
    "sourceType": 1,
    "mimeType": "sample string 2",
    "OriginalFileId": "sample string 3",
    "signedFileRepoId": "sample string 4",
    "signature": "sample string 5",
    "isTemplate": true,
    "customId": "sample string 7"
  },
  {
    "id": "c6975585-4636-4962-8c0f-d321456cb566",
    "name": "sample string 1",
    "sourceType": 1,
    "mimeType": "sample string 2",
    "OriginalFileId": "sample string 3",
    "signedFileRepoId": "sample string 4",
    "signature": "sample string 5",
    "isTemplate": true,
    "customId": "sample string 7"
  }
]

application/xml, text/xml

Sample:
<ArrayOfUploadMetadata xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Itslearning.Web.UI.Controls.Uploaders.Metadata">
  <UploadMetadata>
    <CustomId>sample string 7</CustomId>
    <Id>5840abc8-ab7a-4897-bde0-71b03b56d3df</Id>
    <IsTemplate>true</IsTemplate>
    <MimeType>sample string 2</MimeType>
    <Name>sample string 1</Name>
    <OriginalFileId>sample string 3</OriginalFileId>
    <Signature>sample string 5</Signature>
    <SignedFileRepoId>sample string 4</SignedFileRepoId>
    <SourceType>Dropbox</SourceType>
  </UploadMetadata>
  <UploadMetadata>
    <CustomId>sample string 7</CustomId>
    <Id>c6975585-4636-4962-8c0f-d321456cb566</Id>
    <IsTemplate>true</IsTemplate>
    <MimeType>sample string 2</MimeType>
    <Name>sample string 1</Name>
    <OriginalFileId>sample string 3</OriginalFileId>
    <Signature>sample string 5</Signature>
    <SignedFileRepoId>sample string 4</SignedFileRepoId>
    <SourceType>Dropbox</SourceType>
  </UploadMetadata>
</ArrayOfUploadMetadata>

application/x-www-form-urlencoded

Sample:
No sample available

Response Information

Resource Description

Collection of Itslearning.RestApi.Entities.Personal.Course.CreateFileResponse
NameDescriptionTypeAdditional information
ElementId

Element id for the file created

integer

None.

CloudId

The cloud id of the file created

string

None.

ErrorMessage

The error message if creation failed

string

None.

ErrorCodes

The error message if creation failed

Collection of Itslearning.RestApi.Entities.Personal.Course.FileErrorCode

None.

Success

If the creation was successful or not

boolean

None.

Title

The title for the newly created file element

string

None.

Response Formats

application/json, text/json

Sample:
[
  {
    "ElementId": 1,
    "CloudId": "sample string 2",
    "ErrorMessage": "sample string 3",
    "ErrorCodes": [],
    "Success": true,
    "Title": "sample string 5"
  },
  {
    "ElementId": 1,
    "CloudId": "sample string 2",
    "ErrorMessage": "sample string 3",
    "ErrorCodes": [],
    "Success": true,
    "Title": "sample string 5"
  }
]

application/xml, text/xml

Sample:
<ArrayOfCreateFileResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <CreateFileResponse>
    <CloudId>sample string 2</CloudId>
    <ElementId>1</ElementId>
    <ErrorCodes xmlns:d3p1="http://schemas.datacontract.org/2004/07/Itslearning.RestApi.Entities.Personal.Course" />
    <ErrorMessage>sample string 3</ErrorMessage>
    <Success>true</Success>
    <Title>sample string 5</Title>
  </CreateFileResponse>
  <CreateFileResponse>
    <CloudId>sample string 2</CloudId>
    <ElementId>1</ElementId>
    <ErrorCodes xmlns:d3p1="http://schemas.datacontract.org/2004/07/Itslearning.RestApi.Entities.Personal.Course" />
    <ErrorMessage>sample string 3</ErrorMessage>
    <Success>true</Success>
    <Title>sample string 5</Title>
  </CreateFileResponse>
</ArrayOfCreateFileResponse>