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*}
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports digitaluapi.ServiceInterface

Namespace Global

    Namespace digitaluapi.ServiceInterface

        Public Partial Class File
            Public Overridable Property Name As String
            Public Overridable Property Extension As String
            Public Overridable Property FileSizeBytes As Long
            Public Overridable Property ModifiedDate As Date
            Public Overridable Property IsTextFile As Boolean
        End Class

        Public Partial Class FileResult
            Public Overridable Property Name As String
            Public Overridable Property Extension As String
            Public Overridable Property FileSizeBytes As Long
            Public Overridable Property ModifiedDate As Date
            Public Overridable Property IsTextFile As Boolean
            Public Overridable Property Contents As String
        End Class

        Public Partial Class Files
            Public Overridable Property Path As String
            Public Overridable Property TextContents As String
            Public Overridable Property ForDownload As Boolean
        End Class

        Public Partial Class FilesResponse
            Public Overridable Property Directory As FolderResult
            Public Overridable Property File As FileResult
            Public Overridable Property ResponseStatus As ResponseStatus
        End Class

        Public Partial Class Folder
            Public Overridable Property Name As String
            Public Overridable Property ModifiedDate As Date
            Public Overridable Property FileCount As Integer
        End Class

        Public Partial Class FolderResult
            Public Overridable Property Folders As List(Of Folder)
            Public Overridable Property Files As List(Of File)
        End Class
    End Namespace
End Namespace

VB.NET Files DTOs

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

HTTP + OTHER

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/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Path":"String","TextContents":"String","ForDownload":false}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

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