All Classes Pages
GetCustomerGrantExamples Class Reference

More...

Detailed Description

Examples for GET grants of a customer

Example 1 - Get grants of a customer

This example demonstrates the following:

  • Retrieving the grants for a customer who has grants on other customers and has given grants to other customers.

XML

Request

Method URL
GET /ws/v12/interaction/customer/1000/grant

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" standalone="yes" ?>
<grants xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/customer"
xmlns:ns2="http://bindings.egain.com/ws/model/v12/gen/interaction/case"
xmlns:ns3="http://bindings.egain.com/ws/model/v12/gen/interaction/activity"
xmlns:ns4="http://bindings.egain.com/ws/model/v12/gen/platform"
xmlns:ns5="http://bindings.egain.com/ws/model/v12/gen/common"
xmlns:ns6="http://bindings.egain.com/ws/model/v12/gen/interaction/folder"
xmlns:ns7="http://bindings.egain.com/ws/model/v12/gen/interaction/attachment"
xmlns:ns8="http://bindings.egain.com/ws/model/v12/gen/mail/alias"
xmlns:ns9="http://bindings.egain.com/ws/model/v12/gen/live/entrypoint"
xmlns:ns10="http://bindings.egain.com/ws/model/v12/gen/interaction/contactperson"
xmlns:ns11="http://bindings.egain.com/ws/model/v12/gen/interaction/contactpoint">
    <grantsOn>
        <customer id="1002">
            <link rel="customer" href="/system/ws/v12/interaction/customer/1002"/>
            <customerName>Kerry  Simpson</customerName>
        </customer>
    </grantsOn>
    <grantsTo>
        <customer id="1001">
            <link rel="customer" href="/system/ws/v12/interaction/customer/1001"/>
            <customerName>Jacob  Marshall</customerName>
        </customer>
    </grantsTo>
</grants>

     


JSON

Request

Method URL
GET /ws/v12/interaction/customer/1000/grant

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

{
    "grantsOn": {
        "customer": [
            {
                "link": {
                    "rel": "customer",
                    "href": "/system/ws/v12/interaction/customer/1002"
                },
                "customerName": "Kerry  Simpson",
                "id": 1002
            }
        ]
    },
    "grantsTo": {
        "customer": [
            {
                "link": {
                    "rel": "customer",
                    "href": "/system/ws/v12/interaction/customer/1001"
                },
                "customerName": "Jacob  Marshall",
                "id": 1001
            }
        ]
    }
}