PUT api/resources

Adds a new resource to the repository. All bytes of the resource is expected to be in the request. ~50MB max resource size.

Request Information

URI Parameters

None.

Body Parameters

Arguments describing the new resource and containing the bytes for the resource.

NewResourceArgs
NameDescriptionTypeAdditional information
Application

Application putting the resource into the repository.

string

None.

OriginalFilename

Original filename of the resource

string

None.

TimeToLiveAfterLastAccess

Indicates how long after last access to automatically delete the resource.

time interval

None.

StartCheckingTimeToLiveAtUtc

Indicates when the TimeToLive will start being checked.

date

None.

Tags

List of tags to associate with the resource

Collection of Pair of string [key] and string [value]

None.

Md5Digest

The Md5Digest of the resource bytes. This helps ensure the resource got transferred correctly.
https://msdn.microsoft.com/en-us/library/system.security.cryptography.md5.aspx
"The quick brown fox jumps over the lazy dog" = 9e107d9d372bb6826bd81d3542a419d6
"The quick brown fox jumps over the lazy dog." = e4d909c290d0fb1ca068ffaddf22cbd0
"" = d41d8cd98f00b204e9800998ecf8427e

string

None.

ResourceBytes

The bytes of the resource to be stored.

Collection of byte

None.

UniqueInstanceIdentifier

String that will uniquely identify an instance uploading files.

string

None.

Request Formats

application/json, text/json

Sample:
{
  "Application": "sample string 1",
  "OriginalFilename": "sample string 2",
  "TimeToLiveAfterLastAccess": "00:00:00.1234567",
  "StartCheckingTimeToLiveAtUtc": "2024-05-18T23:43:31.9149993-04:00",
  "Tags": [
    {
      "Key": "sample string 1",
      "Value": "sample string 2"
    },
    {
      "Key": "sample string 1",
      "Value": "sample string 2"
    }
  ],
  "Md5Digest": "sample string 3",
  "ResourceBytes": "QEA=",
  "UniqueInstanceIdentifier": "sample string 4"
}

application/xml, text/xml

Sample:
<NewResourceArgs xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Application>sample string 1</Application>
  <OriginalFilename>sample string 2</OriginalFilename>
  <TimeToLiveAfterLastAccess />
  <StartCheckingTimeToLiveAtUtc>2024-05-18T23:43:31.9149993-04:00</StartCheckingTimeToLiveAtUtc>
  <Tags>
    <KeyValuePairOfStringString />
    <KeyValuePairOfStringString />
  </Tags>
  <Md5Digest>sample string 3</Md5Digest>
  <ResourceBytes>QEA=</ResourceBytes>
  <UniqueInstanceIdentifier>sample string 4</UniqueInstanceIdentifier>
</NewResourceArgs>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

A structure containing the meta data of the new resource. In the case of a MD5 hash mismatch, a HTTP Status of 422 will be returned. https://tools.ietf.org/html/rfc4918#section-11.2

ResourceMetaData
NameDescriptionTypeAdditional information
ResourceIdentifier

The identifier for the resource

globally unique identifier

None.

Application

The application the resource belongs to

string

None.

OriginalFilename

Original filename of the resource

string

None.

SizeInBytes

Size in bytes of the resource

integer

None.

CreatedUtc

DateTime when the resource was added to the system.

date

None.

LastAccessedUtc

DateTime when the resource was last accessed.

date

None.

TimeToLiveAfterLastAccess

Timespan the resource will remain in the repository after the last access date.

time interval

None.

Tags

List of name/value pairs listing the tags associated with the resource.

Collection of Pair of string [key] and string [value]

None.

Md5HashBase64

Md5Hash of the resource as a Base64Encoded string.
If the resource was a string:
"The quick brown fox jumps over the lazy dog" = nhB9nTcrtoJr2B01QqQZ1g==
"The quick brown fox jumps over the lazy dog." = 5NkJwpDQ+xygaP+t3yLL0A==
"" = 1B2M2Y8AsgTpgAmY7PhCfg==

string

None.

Md5HashHexString

Md5Hash of the resource as a hex string.
If the resource was a string:
"The quick brown fox jumps over the lazy dog" = 9e107d9d372bb6826bd81d3542a419d6
"The quick brown fox jumps over the lazy dog." = e4d909c290d0fb1ca068ffaddf22cbd0
"" = d41d8cd98f00b204e9800998ecf8427e

string

None.

Response Formats

application/json, text/json

Sample:
{
  "ResourceIdentifier": "c4e29b26-343b-4417-8b25-f777a3b2f1b8",
  "Application": "sample string 2",
  "OriginalFilename": "sample string 3",
  "SizeInBytes": 1,
  "CreatedUtc": "2024-05-18T23:43:32.0585593-04:00",
  "LastAccessedUtc": "2024-05-18T23:43:32.0585593-04:00",
  "TimeToLiveAfterLastAccess": "00:00:00.1234567",
  "Tags": [
    {
      "Key": "sample string 1",
      "Value": "sample string 2"
    },
    {
      "Key": "sample string 1",
      "Value": "sample string 2"
    }
  ],
  "Md5HashBase64": "sample string 6",
  "Md5HashHexString": "sample string 7"
}

application/xml, text/xml

Sample:
<ResourceMetaData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ResourceIdentifier>c4e29b26-343b-4417-8b25-f777a3b2f1b8</ResourceIdentifier>
  <Application>sample string 2</Application>
  <OriginalFilename>sample string 3</OriginalFilename>
  <SizeInBytes>1</SizeInBytes>
  <CreatedUtc>2024-05-18T23:43:32.0585593-04:00</CreatedUtc>
  <LastAccessedUtc>2024-05-18T23:43:32.0585593-04:00</LastAccessedUtc>
  <TimeToLiveAfterLastAccess />
  <Tags>
    <KeyValuePairOfStringString />
    <KeyValuePairOfStringString />
  </Tags>
  <Md5HashBase64>sample string 6</Md5HashBase64>
  <Md5HashHexString>sample string 7</Md5HashHexString>
</ResourceMetaData>