All Classes Pages
ActivityChangeCaseExamples Class Reference

More...

Detailed Description

Examples for changing case of activities

Example 1 - Change case of an activity to a new case without optional attributes

This example demonstrates the following:

  • Changing the case of a single activity to a new case. The new case is created without any optional attributes. Since all attributes of a case are optional, the case is created without providing any attributes.

XML

Request

Method URL
PUT /ws/v12/interaction/activity/1005/changecase

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" standalone="yes"?>
<case xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/case"
xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/common" />

     

Response:
HTTP/1.1 201 Created

Response headers

Name Value
X-egain-session current session ID
Content-Type application/xml
Location /system/ws/v12/interaction/case/1019

JSON

Request

Method URL
PUT /ws/v12/interaction/activity/1005/changecase

Request headers

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

Request body:

{}

Response:
HTTP/1.1 201 Created

Response headers

Name Value
X-egain-session current session ID
Content-Type application/json
Location /system/ws/v12/interaction/case/1019

     



Example 2 - Change case of an activity to an existing case

This example demonstrates the following:

  • Changing the case of an activity to an existing case.

XML

Request

Method URL
PUT /ws/v12/interaction/activity/1005/changecase

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" standalone="yes"?>
<case id="1011"
xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/case"
xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/common" />

     

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/1005/changecase

Request headers

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

Request body:

{
  "id": 1011
}

Response:
HTTP/1.1 204 No Content

Response headers

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

     


Example 3 - Change case of multiple activities to an existing case and relate the two cases

This example demonstrates the following:

  • Changing the case of multiple activities to an existing case.
  • Relating the old case with the newly associated case of the activities.

XML

Request

Method URL
PUT /ws/v12/interaction/activity/1005,1006/changecase?relateCase=yes

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" standalone="yes"?>
<case id="1011"
xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/case"
xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/common" />

     

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/1005,1006/changecase?relateCase=yes

Request headers

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

Request body:

{
  "id": 1011
}

Response:
HTTP/1.1 204 No Content

Response headers

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

     


Example 4 - Change case of multiple activities to a new case by providing all case attributes

This example demonstrates the following:

  • Changing the case of multiple activities to a new case.
  • Creating the new case with all attributes, including custom attributes.
  • Relating the current case of the activities with the new case

XML

Request

Method URL
PUT /ws/v12/interaction/activity/1005,1006/changecase?relateCase=yes

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" standalone="yes"?>
<case xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/case" xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/common">
      <dueDate>2020-11-30T18:30:00.000Z</dueDate>
      <severity>
         <ns2:value>medium</ns2:value>
      </severity>
      <subject>Issue with phone</subject>
      <description>Phone issue</description>
      <solution>Replace phone</solution>
      <customAttributes>
            <ns2:customAttribute>
                  <ns2:attribName>customer_rating</ns2:attribName>
                  <ns2:attribValues>
                        <ns2:attribValue>
                              <ns2:value>1</ns2:value>
                        </ns2:attribValue>
                  </ns2:attribValues>
            </ns2:customAttribute>
      </customAttributes>
</case>

     

Response:
HTTP/1.1 201 Created

Response headers

Name Value
X-egain-session current session ID
Content-Type application/xml
Location /system/ws/v12/interaction/case/1019

JSON

Request

Method URL
PUT /ws/v12/interaction/activity/1005,1006/changecase?relateCase=yes

Request headers

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

Request body:

{ 
   "dueDate":"2020-11-30T18:30:00.000Z",
   "severity":{ 
      "value":"medium"
   },
   "subject":"Issue with phone",
   "description":"Phone issue",
   "solution":"Replace phone",
   "customAttributes":{ 
      "customAttribute":[ 
         { 
            "attribName":"customer_rating",
            "attribValues":{ 
               "attribValue":[ 
                  { 
                     "value":"1"
                  }
               ]
            }
         }
      ]
   }
}

Response:
HTTP/1.1 201 Created

Response headers

Name Value
X-egain-session current session ID
Content-Type application/json
Location /system/ws/v12/interaction/case/1019