All Classes Pages
CreateCustomerGrantExamples Class Reference

More...

Detailed Description

Examples for create grants on a customer

Example 1 - Provide grants to a single customer

This example demonstrates the following:

  • Providing grant to a single customer.

XML

Request

Method URL
POST /ws/v12/interaction/customer/grant

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"?>
<grants xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/customer">
    <grantsOn>
        <customer id="1000"/>
    </grantsOn>
    <grantsTo>
        <customer id="1001"/>
    </grantsTo>
</grants>

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/customer/1000/grant

     


JSON

Request

Method URL
POST /ws/v12/interaction/customer/grant

Request headers

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

Request body

{
    "grantsOn": {
        "customer": [
            {
                "id": "1000"
            }
        ]
    },
    "grantsTo": {
        "customer": [
            {
                "id": "1001"
            }
        ]
    }
}

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/customer/1000/grant

     



Example 2 - Provide grants to multiple customers

This example demonstrates the following:

  • roviding grant to multiple customers (2 customers in this example).

XML

Request

Method URL
POST /ws/v12/interaction/customer/grant

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" ?>
<grants xmlns="http://bindings.egain.com/ws/model/v12/gen/interaction/customer">
    <grantsOn>
        <customer id="1000"/>
    </grantsOn>
    <grantsTo>
        <customer id="1002"/>
        <customer id="1020"/>
    </grantsTo>
</grants>

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/customer/1000/grant

     


JSON

Request

Method URL
POST /ws/v12/interaction/customer/grant

Request headers

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

Request body

{
    "grantsOn": {
        "customer": [
            {
                "id": "1000"
            }
        ]
    },
    "grantsTo": {
        "customer": [
            {
                "id": "1002"
            },
            {
                "id": "1020"
            }
        ]
    }
}

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/customer/1000/grant