All Classes Pages
CreateCustomerGrantPage Class Reference

More...

Detailed Description

Create customer grants

Overview

This API allows the user to provide grants on a customer to other customers. Refer Customer grants for information about what is a grant.
For the successful execution of this API:

  1. The customer to whom grant is being provided, must be an individual customer.
  2. The customer on whom the grant is being provided, must be an individual customer.
  3. If the customer departmentalization is enabled in the application, both the customers must belong to the same department.
  4. The number of customers to whom grants are being provided must not exceed 75.
Since
11.6

APIs

Method URL Description
POST /ws/v12/interaction/customer/grant Provides grants on a customer to one or more customers.

Authentication

Authentication is required. The client must be logged in to call this API. Each API request must contain X-egain-session request header returned by Login API.

Permissions

All of the following are required:

  • User must have 'Edit Customer' action.
  • If "Customer departmentalization" setting is enabled in the application, then all customers (granted on and granted to) must belong to either the user's home department, or to a department where the user is a foreign user.

Licenses

The logged in user must have the following licenses:

Request

Request headers

Name Description Allowed values Default value
X-egain-session Session ID obtained from Login API response header N/A N/A
Accept Content type accepted by client. application/xml or application/json N/A
Content-Type Media type sent by the client application/xml or application/json N/A
Accept-Language Language locale accepted by client (used for locale specific fields in resource representation and in error responses) Supported 'Accept-Language' header codes default system language

Request Body

The request body is mandatory. Request body can be in either XML or JSON format:

Elements required in request body

Name Description
grantsOn.customer.id Customer on whom the grants will be provided.
grantsTo.customer.id This will specify the customers to whom the grant will be provided.

Optional elements allowed in request body

   None

Request body XML schemas:

  • v12-schema-interaction-customer-Grants

Supported API specific query parameters

   None

Supported common query parameters

   None

Response

Response headers

Name Description Possible values
X-egain-session Session ID of the current user session N/A
Content-Type Media type of response body application/xml or application/json
Location URL listing the grants for the customer providing the grants interaction/customer/{ID}/grant

Response body XML schemas:

  • schema-kb-WSError - used in case of error

HTTP status codes

Success Status codes

201 - Created

  • The request was successfully executed.

Failure Status codes

400 - Bad Request

  • Any query parameter is sent in the request.
  • Request body does not contain the required elements.
  • An unsupported element is present in the request body.
  • Elements provided do not adhere to the rules stated in the Request Body section.
  • Request body is empty.

401 - Unauthorized

  • X-egain-session request header is missing.
  • Session is invalid or expired.

403 - Forbidden

  • The user does not have sufficient permissions. Refer Permissions section for details.

406 - Not Acceptable

  • Invalid 'Accept-Language' header value

500 - Internal server error

Examples:

Example 1 - Provide grants to a single customer
Example 2 - Provide grants to multiple customers