NAV Navigation
Shell Node.js HTTP

Alvaria Cloud Customer Experience Disposable App REST API v2.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Overview

The Alvaria™ Cloud Customer Experience REST API, provided by the CX Server, facilitates easy integration with other systems by providing access to the endpoints needed to interact with the Disposable App Feature

In order to utilize the Customer Experience REST API the customerexperienceapi scope is required.

Base URLs:

License: License: Creative Commons Attribution 4.0 International Public License

Authentication

Scope Scope Description
customerexperienceapi manage the complete customer experience api
customerexperienceapi.disposableapp manage customer experience - disposable apps

Context

Get Context

Code samples

# You can also use wget
curl -X GET https://orgId.via.aspect-cloud.net/via/v2/organizations/{orgId}/customerexperience/disposableApp/context?sessionId=string \
  -H 'Accept: application/json' \
  -H 'Authorization: string' \
  -H 'x-api-key: string'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'string',
  'x-api-key':'string'
};

fetch('https://orgId.via.aspect-cloud.net/via/v2/organizations/{orgId}/customerexperience/disposableApp/context?sessionId=string',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET https://orgId.via.aspect-cloud.net/via/v2/organizations/{orgId}/customerexperience/disposableApp/context?sessionId=string HTTP/1.1
Host: orgid.via.aspect-cloud.net
Accept: application/json
Authorization: string
x-api-key: string

GET /via/v2/organizations/{orgId}/customerexperience/disposableApp/context

Returns the Context set on a disposable App object

Parameters

Name In Type Required Description
orgId path string true Name of a customer organization
sessionId query string true Dialog Id where the disposable app is running.
Authorization header string true Authentication token with the value: 'Bearer {accessToken}', where {accessToken} was returned from a call to the authorization endpoint
x-api-key header string true Alvaria-provided value used to track API endpoint usage

Example responses

200 Response

{
  "kind": "cxp#disposableAppContext",
  "content": "Context"
}

Responses

Status Meaning Description Schema
200 OK Successful response Context
400 Bad Request Validation exception ErrorResponse
401 Unauthorized Unauthorized None
404 Not Found Dialog Id not found on the cluster ErrorResponse
406 Not Acceptable An output format different from XML and JSON was requested ErrorResponse
500 Internal Server Error Internal server error ErrorResponse

Outcome

Post Outcome

Code samples

# You can also use wget
curl -X POST https://orgId.via.aspect-cloud.net/via/v2/organizations/{orgId}/customerexperience/disposableApp/outcome?sessionId=string \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: string' \
  -H 'x-api-key: string'

const fetch = require('node-fetch');
const inputBody = {
  "kind": "cxp#disposableAppOutcome",
  "variables": [
    {
      "id": "variable1",
      "value": "Value set by the external Web App"
    }
  ]
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'string',
  'x-api-key':'string'
};

fetch('https://orgId.via.aspect-cloud.net/via/v2/organizations/{orgId}/customerexperience/disposableApp/outcome?sessionId=string',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST https://orgId.via.aspect-cloud.net/via/v2/organizations/{orgId}/customerexperience/disposableApp/outcome?sessionId=string HTTP/1.1
Host: orgid.via.aspect-cloud.net
Content-Type: application/json
Accept: application/json
Authorization: string
x-api-key: string

POST /via/v2/organizations/{orgId}/customerexperience/disposableApp/outcome

This endpoint is called when the external disposable app is completed

Body parameter

{
  "kind": "cxp#disposableAppOutcome",
  "variables": [
    {
      "id": "variable1",
      "value": "Value set by the external Web App"
    }
  ]
}

Parameters

Name In Type Required Description
orgId path string true Name of a customer organization
sessionId query string true Dialog Id where the disposable app is running.
Authorization header string true Authentication token with the value: 'Bearer {accessToken}', where {accessToken} was returned from a call to the authorization endpoint
x-api-key header string true Alvaria-provided value used to track API endpoint usage
body body Outcome true none

Example responses

400 Response

{
  "code": "400",
  "message": "Validation exception",
  "errors": [
    {
      "scope": "global",
      "reason": "Invalid request",
      "message": "The value for the channel is invalid"
    }
  ]
}

Responses

Status Meaning Description Schema
204 No Content Successful response None
400 Bad Request Validation exception ErrorResponse
401 Unauthorized Unauthorized None
404 Not Found Dialog Id not found on the cluster ErrorResponse
406 Not Acceptable An output format different from XML and JSON was requested ErrorResponse
500 Internal Server Error Internal server error ErrorResponse

Schemas

Context

{
  "kind": "cxp#disposableAppContext",
  "content": "Context"
}

Properties

Name Type Required Restrictions Description
kind string false none Identifier used by Alvaria™ Cloud components to serialize the payload of the results
content string false none The content set on the disposable app

Outcome

{
  "kind": "cxp#disposableAppOutcome",
  "variables": [
    {
      "id": "variable1",
      "value": "Value set by the external Web App"
    }
  ]
}

Properties

Name Type Required Restrictions Description
kind string false none Identifier used by Alvaria™ Cloud components to serialize the payload of the results
variables [object] false none List of variables to be set
» id string false none Unique ID that matches a reference id of a CX script variable or creates a new session variable with that name
» value string false none Value to be assigned to the variable or session variable

ErrorResponse

{
  "code": "400",
  "message": "Validation exception",
  "errors": [
    {
      "scope": "global",
      "reason": "Invalid request",
      "message": "The value for the channel is invalid"
    }
  ]
}

Properties

Name Type Required Restrictions Description
code integer false none HTTP error status
message string false none none
errors [Error] false none none

Error

{
  "scope": "global",
  "reason": "Invalid request",
  "message": "The value for the channel is invalid"
}

Properties

Name Type Required Restrictions Description
scope string false none none
reason string false none none
message string false none none