Status in channelData v3

List of the status returned by Aura with channelData model v3

Introduction

The status field represents how the request made to Aura has worked, trying to summarize if it has been successful or it has failed and the reason for it.

⚠️ All cases described as future-case are currently not implemented, although in future releases this could change.

How to use status in v3

import { AURA_STATUS_V3 } from '@telefonica/aura-utilities/lib/aura-models';
import { AuraResponseStatusV3 } from '@telefonica/aura-bot-utilities/lib/aura-bot-common';

channelData.status = new AuraResponseStatusV3(AURA_STATUS_V3.SUCCESS, correlator);
console.log(channelData.status);
/* Prints
{
    code: 'SUCCESS',
    message: 'Success'
}
*/

If you need a status with parameters, add it as a third parameter:

channelData.status = new AuraResponseStatusV3(AURA_STATUS_V3.ERROR.CHANNELDATA.VALIDATING, correlator, {appName: 'FakeApp'});
console.log(channelData.status);
/* Prints
{
    code: 'ERROR.CHANNELDATA.VALIDATING',
    message: 'App dialogs are not installed'
    params: {
      appName: 'FakeApp'
    }
}
*/

Parameters should match the definition of the status. If not, some errors will be logged:

  • With missing parameters:
channelData.status = new AuraResponseStatusV3(AURA_STATUS_V3.ERROR.CHANNELDATA.VALIDATING, correlator);
/* Error logged
ERROR: `Missing parameter in status constructor`
STCK: {
 status: {
    code: 'ERROR.CHANNELDATA.VALIDATING',
    message: 'App dialogs are not installed',
    params: ['appName']
 },
 params: undefined
}
  • With wrong parameters:
channelData.status = new AuraResponseStatusV3(AURA_STATUS_V3.ERROR.CHANNELDATA.VALIDATING, correlator, { appName: 'TestApp', reason: 'WRONG_REASON'});
/* Error logged
ERROR: `Invalid parameter reason in status constructor`
STCK: {
 status: {
    code: 'ERROR.CHANNELDATA.VALIDATING',
    message: 'Error handling terms and conditions',
    params: ['appName', { reason: [ 'CANNOT_CHECK', 'CANNOT_UPDATE']}]
 },
 params: { appName: 'TestApp', reason: 'WRONG_REASON'}
}
  • With extra parameters, there is no error logged. You can add all the extra params you require:
channelData.status = new AuraResponseStatusV3(AURA_STATUS_V3.SUCCESS, correlator, { allOk: 'Yes, sure' });
console.log(channelData.status);
/* Prints
{
    code: 'SUCCESS',
    message: 'Success',
    params: {
      allOk: 'Yes, sure'
    }
}

List of status returned by Aura Bot

Success status

Code Message
SUCCESS Success

TV Channel

Code Message Description
SUCCESS.NO_CONTENT Success with no content This success occurs when the response does not include any content but the request was successful.

Error status

ChannelData

Code Params Message Description
ERROR.CHANNELDATA.VALIDATING errors (array of invalid fields/values in channelData) channelData validation error This error occurs when the channelData sent in the request does not follow the request channelData v3 schema.

Context

Code Params Message Description
ERROR.CONTEXT.VALIDATING errors (invalid fields/values) channelData context validation error future case. This error occurs when the context being validated has a wrong format.

Target

Code Params Message Description
ERROR.TARGET target
reason: [NOT_EXIST, NOT_ALLOWED, UNLIKED, OTHER]
[key:value]
Action Target Error See Params cases for more information.
Target error params cases
Code Message Description
NOT_EXIST Action Target Error If there is no valid STB ID and channelData.appContext.location.logical === 'home', then NOT_EXIST is returned.
UNLIKED Action Target Error If STB ID exists and is valid and channelData.appContext.location.logical === 'home', but there is no channelData.appContext.application.playing.
OTHER Action Target Error future case. Other errors.

Content

Code Message Description
ERROR.CONTENT.NOT_INCLUDED Action Target Error future case. This error occurs when an action has no target.

TV Channel

Code Message Description
ERROR.TV_CHANNEL.NOT_INCLUDED TV Channel not included future case. This error occurs when the TV channel supplied in the request is not included.
ERROR.TV_CHANNEL.NOT_SUPPORTED TV Channel not supported future case. This error occurs when the TV channel supplied in the request is not supported.
ERROR.INVALID_REQUEST TV Channel invalid request future case. This error occurs when the request is not a valid request.
ERROR.CONTENT.NOT_FOUND TV Channel content not found future case. This error occurs when the TV channel supplied in the request is not found.

Entities

Code Params Message Description
ERROR.ENTITIES reason: [INCOMPATIBLE, NOT_SUPPORTED]
[type, entity]
Entities Error future case. This error occurs if there is a problem with the entities provided.

Intent

Code Params Message Description
ERROR.INTENT reason: [NOT_SUPPORTED] Intent not Supported Error This error occurs if the intent informed in the request is not configured for the channel.

User

Code Params Message Description
ERROR.USER.UNAUTHENTICATED auraId Invalid aura user This error occurs if the user informed in the request is not correctly formatted or does not exist.
ERROR.USER.FORBIDDEN reason: error log User profile or consents error future case. This error occurs if the user has been forbidden.

Internal

Code Params Message Description
ERROR.INTERNAL reason: error log Internal Error This error occurs if an external API returns an error, which is being propagated in the reason param or there is an internal error in aura-bot.