You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Resource: Temporary Attachment Set ( /api/temporaryattachmentset/{id} )

Provides the mechanism for retrieving a list of attachments in a set, or adding new attachments to the set.

This resource supports the following methods: GET, POST

Methods

GET


Retrieves a list of attachments in the temporary attachment set.

This method supports the OData parameters $filter, $top, $take, $orderby and $inlinecount. See OData Topic for more details.

Status Codes

These are the expected status codes returned by the service - in addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the request is completed successfully.

Example - GET

Retrieves a list of all attachments associated with a temporary attachment set.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610Unique identifier of the temporary attachment set.

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

{
  "Items": [
    {
      "TemporaryId": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
      "Id": "00000000-0000-0000-0000-000000000000",
      "Name": "Test Image",
      "FileName": "test.png",
      "ContentType": "image/png",
      "CreatedAt": "2014-02-13T21:04:45Z",
      "CreatedById": "2b364daa-0dff-4a6f-8554-f5963d3011be",
      "Size": 122454,
      "Self": "http://localhost/api/temporaryattachmentset/4bb709c2-e0e7-4af3-9f60-a045016a9610/attachment/00000000-0000-0000-0000-000000000000",
      "Content": "http://localhost/api/attachment/00000000-0000-0000-0000-000000000000/contents"
    },
    {
      "TemporaryId": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
      "Id": "00000000-0000-0000-0000-000000000000",
      "Name": "Test Image 2",
      "FileName": "test2.png",
      "ContentType": "image/png",
      "CreatedAt": "2014-02-13T21:04:45Z",
      "CreatedById": "2b364daa-0dff-4a6f-8554-f5963d3011be",
      "Size": 23132,
      "Self": "http://localhost/api/temporaryattachmentset/4bb709c2-e0e7-4af3-9f60-a045016a9610/attachment/00000000-0000-0000-0000-000000000000",
      "Content": "http://localhost/api/attachment/00000000-0000-0000-0000-000000000000/contents"
    }
  ]
}

Status Code

201 - Created

POST


Upload one or more attachments.

Status Codes

These are the expected status codes returned by the service - in addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
201 - CreatedReturned if attachments were uploaded successfully.
403 - ForbiddenReturned if the multipart request did not contain any files.
415 - UnsupportedMediaTypeReturned if the request is not mime multipart.

Example - POST

Uploads one or more files using a mime multipart request. This example shows a response where two files were uploaded.

Request Headers

KeyValueDescription
Content-Typemultipart/mixed; boundary=65bf6b94-c91c-442c-abe7-f41444d7c71f

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610Unique identifier of the temporary attachment set.

Request Body

--65bf6b94-c91c-442c-abe7-f41444d7c71f
Content-Disposition: attachment; filename=screenshot1.png; name="screenshot 1"; size=122454
Content-Type: image/png
Content-Length: 3
...
--65bf6b94-c91c-442c-abe7-f41444d7c71f
Content-Disposition: attachment; filename=notes.txt; name=notes; size=3
Content-Type: text/plain
Content-Length: 3
ABC
--65bf6b94-c91c-442c-abe7-f41444d7c71f--

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

[
  {
    "TemporaryId": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
    "Id": "00000000-0000-0000-0000-000000000000",
    "Name": "screenshot 1",
    "FileName": "screenshot1.png",
    "ContentType": "image/png",
    "CreatedAt": "2012-01-01T14:04:05Z",
    "CreatedById": "2b364daa-0dff-4a6f-8554-f5963d3011be",
    "Size": 122454,
    "Self": "http://localhost/api/temporaryattachmentset/4bb709c2-e0e7-4af3-9f60-a045016a9610/attachment/00000000-0000-0000-0000-000000000000",
    "Content": "http://localhost/api/attachment/00000000-0000-0000-0000-000000000000/contents"
  },
  {
    "TemporaryId": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
    "Id": "00000000-0000-0000-0000-000000000000",
    "Name": "notes.txt",
    "FileName": "notes",
    "ContentType": "text/plain",
    "CreatedAt": "2012-01-01T14:04:05Z",
    "CreatedById": "2b364daa-0dff-4a6f-8554-f5963d3011be",
    "Size": 3,
    "Self": "http://localhost/api/temporaryattachmentset/4bb709c2-e0e7-4af3-9f60-a045016a9610/attachment/00000000-0000-0000-0000-000000000000",
    "Content": "http://localhost/api/attachment/00000000-0000-0000-0000-000000000000/contents"
  }
]

Status Code

201 - Created

  • No labels