digitaluapi

<back to all web services

Files

Requires Authentication
Requires any of the roles:Client, Admin, Partner
The following routes are available for this service:
All Verbs/restfiles/files
All Verbs/restfiles/files/{Path*}
namespace digitaluapi.ServiceInterface

open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type Files() = 
        member val Path:String = null with get,set
        member val TextContents:String = null with get,set
        member val ForDownload:Boolean = new Boolean() with get,set

    [<AllowNullLiteral>]
    type Folder() = 
        member val Name:String = null with get,set
        member val ModifiedDate:DateTime = new DateTime() with get,set
        member val FileCount:Int32 = new Int32() with get,set

    [<AllowNullLiteral>]
    type File() = 
        member val Name:String = null with get,set
        member val Extension:String = null with get,set
        member val FileSizeBytes:Int64 = new Int64() with get,set
        member val ModifiedDate:DateTime = new DateTime() with get,set
        member val IsTextFile:Boolean = new Boolean() with get,set

    [<AllowNullLiteral>]
    type FolderResult() = 
        member val Folders:ResizeArray<Folder> = null with get,set
        member val Files:ResizeArray<File> = null with get,set

    [<AllowNullLiteral>]
    type FileResult() = 
        member val Name:String = null with get,set
        member val Extension:String = null with get,set
        member val FileSizeBytes:Int64 = new Int64() with get,set
        member val ModifiedDate:DateTime = new DateTime() with get,set
        member val IsTextFile:Boolean = new Boolean() with get,set
        member val Contents:String = null with get,set

    [<AllowNullLiteral>]
    type FilesResponse() = 
        member val Directory:FolderResult = null with get,set
        member val File:FileResult = null with get,set
        member val ResponseStatus:ResponseStatus = null with get,set

F# Files DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /restfiles/files HTTP/1.1 
Host: duengageapi.uat.scadsoftware.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Path: String,
	TextContents: String,
	ForDownload: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Directory: 
	{
		Folders: 
		[
			{
				Name: String,
				ModifiedDate: 0001-01-01,
				FileCount: 0
			}
		],
		Files: 
		[
			{
				Name: String,
				Extension: String,
				FileSizeBytes: 0,
				ModifiedDate: 0001-01-01,
				IsTextFile: False
			}
		]
	},
	File: 
	{
		Name: String,
		Extension: String,
		FileSizeBytes: 0,
		ModifiedDate: 0001-01-01,
		IsTextFile: False,
		Contents: String
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}