All Classes Pages
EditCompletedActivityExamples Class Reference

More...

Detailed Description

Examples of Edit Completed Activity

Example 1 - Modify completed chat activity with required attributes and content

This example demonstrates the following:

  • Modifying completed chat activity with required attributes and content.

XML

Request

Method URL
PUT /ws/v12/interaction/activity

Request headers

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

Request body:

<?xml version="1.0" encoding="UTF-8"?>
<activities xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/activity" xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/common">
   <activity id="1001">
      <lastModified date="2017-11-26T11:07:50.790Z" />
      <payload>
         <chat>
            <transcript>
               <content>
                  <ns2:type>html</ns2:type>
                  <ns2:value>Contents are removed.</ns2:value>
               </content>
            </transcript>
         </chat>
      </payload>
   </activity>
</activities>

Response:
HTTP/1.1 204 No Content

Response headers

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

     


JSON

Request

Method URL
PUT /ws/v12/interaction/activity

Request headers

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

Request body:

{
    "activity": [{
        "id": "1001",
        "lastModified": {
            "date": "2017-11-26T11:37:50.790Z"
        },
        "payload": {
            "chat": {
                "transcript": {
                    "content": [{
                        "type": "html",
                        "value": "Contents are removed."
                    }]
                }
            }
        }
    }]
}

Response:
HTTP/1.1 204 No Content

Response headers

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

     



Example 2 - Modify completed chat activity with all attributes

This example demonstrates the following:

  • Modifying completed chat activity with all attributes.

XML

Request

Method URL
PUT /ws/v12/interaction/activity

Request headers

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

Request body:

<?xml version="1.0" encoding="UTF-8"?>
<activities xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/activity" xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/common">
   <activity id="1000">
      <lastModified date="2017-07-31T16:20:50.00Z" />
      <payload>
         <chat>
            <transcript>
               <content>
                  <ns2:type>html</ns2:type>
                  <ns2:value>Contents are removed.</ns2:value>
               </content>
            </transcript>
         </chat>
      </payload>
      <customAttributes>
         <ns2:customAttribute>
            <ns2:attribName>customer_rating</ns2:attribName>
            <ns2:attribValues>
               <ns2:attribValue>
                  <ns2:value>5</ns2:value>
               </ns2:attribValue>
            </ns2:attribValues>
         </ns2:customAttribute>
      </customAttributes>
   </activity>
</activities>

Response:
HTTP/1.1 204 No Content

Response headers

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

     


JSON

Request

Method URL
PUT /ws/v12/interaction/activity

Request headers

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

Request body:

{  
   "activity":[  
      {  
         "id":"1000",
         "lastModified":{  
            "date":"2017-07-31T14:43:31.77Z"
         },
         "payload":{  
            "chat":{  
               "transcript":{  
                  "content":[  
                     {  
                        "type":"html",
                        "value":"Contents are removed."
                     }
                  ]
               }
            }
         },
         "customAttributes":{  
            "customAttribute":[  
               {  
                  "attribName":"customer_rating",
                  "attribValues":{  
                     "attribValue":[  
                        {  
                           "value":"5"
                        }
                     ]
                  }
               }
            ]
         }
      }
   ]
}

Response:
HTTP/1.1 204 No Content

Response headers

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

     



Example 3 - Modify completed email activity with required attributes and content

This example demonstrates the following:

  • Modifying completed email activity with required attributes and html content.

XML

Request

Method URL
PUT /ws/v12/interaction/activity

Request headers

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

Request body:

<?xml version="1.0" encoding="UTF-8"?>
<activities xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/activity" xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/common">
   <activity id="1004">
      <lastModified date="2017-11-26T11:57:50.790Z" />
      <payload>
         <email>
            <contents>
               <content>
                  <ns2:type>html</ns2:type>
                  <ns2:value>&lt;b&gt;Contents are removed.&lt;/b&gt;</ns2:value>
               </content>
            </contents>
         </email>
      </payload>
   </activity>
</activities>

Response:
HTTP/1.1 204 No Content

Response headers

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

     


JSON

Request

Method URL
PUT /ws/v12/interaction/activity

Request headers

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

Request body:

{
    "activity": [{
        "id": "1004",
        "lastModified": {
            "date": "2017-11-26T11:47:50.790Z"
        },
        "payload": {
            "email": {
                "contents": {
                    "content": [{
                        "type": "html",
                        "value": "<b>Contents are removed.</b>"
                    }]
                }
            }
        }
    }]
}

Response:
HTTP/1.1 204 No Content

Response headers

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

     



Example 4 - Modify completed email activity with all attributes

This example demonstrates the following:

  • Modifying completed email activity with all attributes.

XML

Request

Method URL
PUT /ws/v12/interaction/activity

Request headers

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

Request body:

<?xml version="1.0" encoding="UTF-8"?>
<activities xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/activity" xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/common">
   <activity id="1004">
      <lastModified date="2017-11-26T12:07:50.790Z" />
      <payload>
         <email>
            <contents>
               <content>
                  <ns2:type>text</ns2:type>
                  <ns2:value>Contents are removed.</ns2:value>
               </content>
               <content>
                  <ns2:type>html</ns2:type>
                  <ns2:value>Contents are removed.</ns2:value>
               </content>
            </contents>
         </email>
      </payload>
      <customAttributes>
         <ns2:customAttribute>
            <ns2:attribName>customer_rating</ns2:attribName>
            <ns2:attribValues>
               <ns2:attribValue>
                  <ns2:value>5</ns2:value>
               </ns2:attribValue>
            </ns2:attribValues>
         </ns2:customAttribute>
      </customAttributes>
   </activity>
</activities>

Response:
HTTP/1.1 204 No Content

Response headers

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

     


JSON

Request

Method URL
PUT /ws/v12/interaction/activity

Request headers

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

Request body:

{
    "activity": [{
        "id": "1004",
        "lastModified": {
            "date": "2017-11-26T12:37:50.790Z"
        },
        "payload": {
            "email": {
                "contents": {
                    "content": [{
                        "type": "text",
                        "value": "Contents are removed."
                    }, {
                        "type": "html",
                        "value": "<b>Contents are removed.</b>"
                    }]
                }
            }
        },
        "customAttributes": {
            "customAttribute": [{
                "attribName": "customer_rating",
                "attribValues": {
                    "attribValue": [{
                        "value": "5"
                    }]
                }
            }]
        }
    }]
}

Response:
HTTP/1.1 204 No Content

Response headers

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