All Classes Pages
EditCaseExamples Class Reference

More...

Detailed Description

Examples for Edit Case

Example 1 - Modify all allowed elements of a case

This example demonstrates the following:

  • Editing all allowed elements of a case.
  • Relating the case with another case. In this example, the case ID 1013 is related to case ID 1002.
  • Removing a relation with another case. In this example, relation of case ID 1013 with case ID 1001 is removed.

XML

Request

Method URL
PUT ws/v12/interaction/case

Request headers

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

Request body

<case xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/case" xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/common" 
      id="1013">
	<lastModified date="2015-07-02T10:45:01Z" />
	<dueDate>2015-11-30T18:30:00.000Z</dueDate>
	<owner>
		<user id="1002"/>
	</owner>
	<severity>
		<ns2:value>urgent</ns2:value>
	</severity>
	<subject>Issue with phone: </subject>
	<description>Phone issue</description>
	<solution>Replace phone :resolution dealing with designated entities and individuals.</solution>
	<relatedCases>
        <link rel="case" href="/system/ws/v12/interaction/case/1002"/> 
   		<unlink rel="case" href="/system/ws/v12/interaction/case/1001"/>
    </relatedCases>
	<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>
</case>

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/case

Request headers

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

Request body

{
        "id": "1000",
        "lastModified": {
          "date": "2015-07-30T13:07:40.000Z"
        },
   		"dueDate": "2015-11-30T18:30:00.000Z",
   		"owner": {
            "user": {
                "id": "1002"
            }
        },
   		"severity": {
            "value":  "urgent"
        },
        "subject": "Issue with phone: ",
        "description": "Phone issue",
        "solution": "Replace phone :resolution dealing with designated entities and individuals.",
		"relatedCases": {
            "link": [
             {
                 "rel": "case",
                 "href": "/system/ws/v12/interaction/case/1001"
             }
           ],      
           "unlink": [
             {
                "rel": "case",
                "href": "/system/ws/v12/interaction/case/1002"
             }
          ]
         },
   		"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 2 - Modify case to remove attribute values

This example demonstrates the following:

  • Removing the existing value of description, due date, owner and a custom attribute of the case.

XML

Request

Method URL
PUT ws/v12/interaction/case

Request headers

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

Request body

<case xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/case" xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/common" 
      id="1000">
	<lastModified date="2015-07-30T13:24:02.000Z" />
	<dueDate/>
        <owner/>
	<description/>
   <customAttributes>
    <ns2:customAttribute>
        <ns2:attribName>customer_rating</ns2:attribName>
       <ns2:attribValues>
                        <ns2:attribValue>
                              <ns2:value></ns2:value>
                        </ns2:attribValue>
                  </ns2:attribValues>
     </ns2:customAttribute>
    </customAttributes>
</case>

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/case

Request headers

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

Request body

{
        "id": "1000",
        "lastModified": {
          "date": "2015-07-30T13:30:53.000Z"
        },
   		"dueDate": "",
                "owner":"",
		"description": "",
   		"customAttributes": {
            "customAttribute": [
                {
                    "attribName":  "customer_rating",
                    "attribValues": {
                        "attribValue": [{
                            "value": ""
                        }]
                    }
                }
            ]
        }
 }

Response
HTTP/1.1 204 No Content

Response headers

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