All Classes Pages
ActivityAttachmentDetailsExamples Class Reference

More...

Detailed Description

Examples for Get Activity Attachment Details

Example 1 - Get details of an attachment

This example demonstrates the following:

  • Getting details of an attachment of an activity without specifying any additional query parameters.

XML

Request

Method URL
GET /ws/v12/interaction/activity/1224/attachment/1011

Request headers

Name Value
X-egain-session Valid session ID
Accept application/xml
Accept-Language en-US

Response
HTTP/1.1 200 OK

Response headers

Name Value
X-egain-session current session ID
Content-Type application/xml

Response body

<?xml version="1.0" encoding="UTF-8"?>
<attachments xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/attachment">
   <attachment id="1011">
      <link rel="self" href="/system/ws/v12/interaction/activity/1224/attachment/1011" />
      <fileName>Gift Coupon.jpg</fileName>
      <contentType>image/pjpeg</contentType>
      <size>172276</size>
      <encodingType>Base 64</encodingType>
      <isBlocked>false</isBlocked>
   </attachment>
</attachments>

     


JSON

Request

Method URL
GET /ws/v12/interaction/activity/1224/attachment/1011

Request headers

Name Value
X-egain-session Valid session ID
Accept application/json
Accept-Language en-US

Response
HTTP/1.1 200 OK

Response headers

Name Value
X-egain-session current session ID
Content-Type application/json

Response body

{
    "attachment": {
        "id": "1011",
        "link": {
            "rel": "self",
            "href": "/system/ws/v12/interaction/activity/1224/attachment/1011"
        },
        "fileName": "Gift Coupon.jpg",
        "contentType": "image/pjpeg",
        "size": "172276",
        "encodingType": "Base 64",
        "isBlocked": "false"
    }
}

     


Example 2 - Get contentUrl along with details for an attachment

This example demonstrates the following:

  • Getting the contentUrl of the attachment as part of getting the details.

XML

Request

Method URL
GET /ws/v12/interaction/activity/1224/attachment/1011?$attribute=contentUrl

Request headers

Name Value
X-egain-session Valid session ID
Accept application/xml
Accept-Language en-US

Response
HTTP/1.1 200 OK

Response headers

Name Value
X-egain-session current session ID
Content-Type application/xml

Response body

<?xml version="1.0" encoding="UTF-8"?>
<attachments xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/attachment">
   <attachment id="1011">
      <link rel="self" href="/system/ws/v12/interaction/activity/1224/attachment/1011" />
      <fileName>Gift Coupon.jpg</fileName>
      <contentType>image/pjpeg</contentType>
      <size>172276</size>
      <encodingType>Base 64</encodingType>
      <isBlocked>false</isBlocked>
      <contentUrl>/system/ws/internal/stream/activity/3535....3344</contentUrl>
   </attachment>
</attachments>

     


JSON

Request

Method URL
GET /ws/v12/interaction/activity/1224/attachment/1011?$attribute=contentUrl

Request headers

Name Value
X-egain-session Valid session ID
Accept application/json
Accept-Language en-US

Response
HTTP/1.1 200 OK

Response headers

Name Value
X-egain-session current session ID
Content-Type application/json

Response body

{
    "attachment": {
        "id": "1011",
        "link": {
            "rel": "self",
            "href": "/system/ws/v12/interaction/activity/1224/attachment/1011"
        },
        "fileName": "Gift Coupon.jpg",
        "contentType": "image/pjpeg",
        "size": "172276",
        "encodingType": "Base 64",
        "isBlocked": "false",
        "contentUrl": "/system/ws/internal/stream/activity/3535....3344"
    }
}

     


Example 3 - Get all attributes along with details for an attachment

This example demonstrates the following:

  • Getting all additional attributes along with details of an attachment. Since 'contentUrl' is the only additional attribute that is supported, it is returned in the response.

XML

Request

Method URL
GET /ws/v12/interaction/activity/1224/attachment/1011?$attribute=all

Request headers

Name Value
X-egain-session Valid session ID
Accept application/xml
Accept-Language en-US

Response
HTTP/1.1 200 OK

Response headers

Name Value
X-egain-session current session ID
Content-Type application/xml

Response body

<?xml version="1.0" encoding="UTF-8"?>
<attachments xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/attachment">
   <attachment id="1011">
      <link rel="self" href="/system/ws/v12/interaction/activity/1224/attachment/1011" />
      <fileName>Gift Coupon.jpg</fileName>
      <contentType>image/pjpeg</contentType>
      <size>172276</size>
      <encodingType>Base 64</encodingType>
      <isBlocked>false</isBlocked>
      <contentUrl>/system/ws/internal/stream/activity/3535....3344</contentUrl>
   </attachment>
</attachments>

JSON

Request

Method URL
GET /ws/v12/interaction/activity/1224/attachment/1011?$attribute=all

Request headers

Name Value
X-egain-session Valid session ID
Accept application/json
Accept-Language en-US

Response
HTTP/1.1 200 OK

Response headers

Name Value
X-egain-session current session ID
Content-Type application/json

Response body

{
    "attachment": {
        "id": "1011",
        "link": {
            "rel": "self",
            "href": "/system/ws/v12/interaction/activity/1224/attachment/1011"
        },
        "fileName": "Gift Coupon.jpg",
        "contentType": "image/pjpeg",
        "size": "172276",
        "encodingType": "Base 64",
        "isBlocked": "false",
        "contentUrl": "/system/ws/internal/stream/activity/3535....3344"
    }
}