All Classes Pages
EditActivityExamples Class Reference

More...

Detailed Description

Examples of Edit Activity

Example 1 - Modify all allowed attributes of an activity

This example demonstrates the following:

  • Editing all allowed attributes of an activity.

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:

<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="2015-12-28T13:38:50.000Z" />
        <dueDate>2020-11-30T18:30:00.000Z</dueDate>
        <priority>5</priority>
        <language>
            <ns2:value>en</ns2:value>         
        </language>
        <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": "2015-12-28T13:38:50.000Z"
            },
            "dueDate": "2020-11-30T18:30:00.000Z",
            "priority": "5",
            "language":{
				"value": "en"
             },
            "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 activity to remove attribute values

This example demonstrates the following:

  • Removing the existing values of a few attributes. This example removes the values of a custom attribute, language, priority, and due date of the activity.

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:

<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="2015-12-30T07:38:15.000Z" />
        <dueDate/>
        <priority/>
        <language>
            <ns2:value/>        
        </language>
        <customAttributes>
            <ns2:customAttribute>
                <ns2:attribName>customer_rating</ns2:attribName>
                <ns2:attribValues>
                    <ns2:attribValue>
                        <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": "2015-12-30T07:38:15.000Z"
            },
            "dueDate": "",
            "priority": "",
            "language":{
				"value": ""
             },
            "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