com.webos.service.filecache

API Summary

The File Cache service enables you to manage caching of files. It implements the global shared cache space, which webOS applications (such as Email) can use to temporary store cache files or send files to other webOS applications.

Overview of the API

(click to expand)

On the system level, the File Cache service is a daemon that starts after the webOS boots. It is responsible for caching filesystem requests, enabling to improve the performance of I/O operations and to save space on the the flash storage device.

You can configure the File Cache service behavior by calling its methods or by editing the options in the FileCache.conf file. In particular, you can:

  • specify the global shared cache space
  • configure space and object parameters
  • specify automatic expiration options or select to control expiration manually.

The default setting of the FileCache.conf file is:

  • totalCacheSpace 104857600 (100 MiB)

Open All


ChangeType

Description

The ChangeType method allows apps to modify the parameters of a cache type other than it’s name. You must specify the name of the cache type, and those cache type parameters that have to be modified. The cache type values are all as defined in DefineType.

Parameters

Name

Required

Type

Description

typeNameRequiredString

Name of cache type to be modified.

loWatermarkOptionalNumber

The minimum space in bytes guaranteed to be available for this cache type.

hiWatermarkOptionalNumber

The maximum space in bytes allowed to be used by this cache type.

sizeOptionalNumber

Default value in bytes for any object inserted into this cache type that does not specify a value for size. Size must not be negative.

costOptionalNumber

Default value between 0 and 100 for any object inserted into this cache type that does not specify a value for cost.

lifetimeOptionalNumber

Default value in seconds for any object inserted into this cache type that does not specify a value for lifetime. lifetime must not be negative.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: CallReturn

return is a CallReturn object. The CallReturn object provides details and examples of the success or failure of the method.

Example

Example of a successful call:
# luna-send -f -n 1 luna://com.webos.service.filecache/ChangeType '{"typeName":"test", "size":1024, "cost":10}'
{
"returnValue": true
}

Example of a failed call:

# luna-send -f -n 1 luna://com.webos.service.filecache/ChangeType '{"typeName":"test3", "size":1024, "cost":10}'
{
"errorCode": -196,
"returnValue": false,
"errorText": "ChangeType: Type 'test3'does not exist."
}


CopyCacheObject

Description

The CopyCacheObject method enables copying of an object from the file cache to a non-cached location. On successful completion, newPathName will be returned as it may be different than expected due to filename collisions. If there is a name collision, the name will be made unique by adding a number to the file basename (i.e. foo.bar may become foo-(1).bar).

Parameters

Name

Required

Type

Description

pathNameRequiredString

The pathName ​is the path of the cache object to be copied

destinationOptionalString

The destination is the path to a target directory, this path will be validated to ensure you have write permissions to that directory.

fileNameOptionalString

The fileName is the name for the target file. If not passed, the fileName will be the value passed when calling InsertCacheObject.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: CopyCacheObjectReturn

Return path to saved file. See CopyCacheObjectReturn for details and examples of the success or failure of the method.

Example

luna-send -n 1 luna://com.webos.service.filecache/CopyCacheObject '{"pathName":"/var/file-cache/test/M/OnRpQABl.bar", "destination":"", "fileName":"foo.bar"}'

=>
{
"newPathName": "/media/internal/downloads/foo.bar",
"returnValue": true
}


DefineType

Description

A DefineType ​method defines a new cache type. This is intended for use by the backup service.

Optionally you may specify the default values for the size, cost, and lifetime. These defaults will be applied to all objects inserted into this cache type that do not specify their own values for these arguments. The size is in bytes, the cost is an integer between 0 and 100, and the lifetime is in seconds.  

The errorCode and errorText are only be returned if the returnValue is false.

Note: You can not define type with the same typeName. Use changeType to change an excisting type.

Parameters

Name

Required

Type

Description

typeNameRequiredString

A typeName is a string up to 64 characters that uniquely identifies the new cache type. A typeName cannot start with a . ( the period character).

loWatermarkRequiredNumber

The minimum space in bytes guaranteed to be available for the cache type.

hiWatermarkRequiredNumber

The maximum space in bytes allowed to be used by the cache type.

sizeOptionalNumber

Default value in bytes for any object inserted into the cache type that does not specify a value for size.

costOptionalNumber

Default value between 0 and 100 for any object inserted into this cache type that does not specify a value for cost.

lifetimeOptionalNumber

Default value in seconds for any object inserted into this cache type that does not specify a value for lifetime.

dirTypeOptionalBoolean

Specifies whether the cache type should create directory entries. This is intended for use by the backup service.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: CallReturn

return is a CallReturn object. The CallReturn object provides details and examples of the success or failure of the method.

Example

Example of a successful call:
# luna-send -f -n 1 luna://com.webos.service.filecache/DefineType '{"typeName":"test", "loWatermark":102400, "hiWatermark":409600}'
{
"returnValue": true
}

Example of a failed call:
# luna-send -f -n 1 luna://com.webos.service.filecache/DefineType '{"typeName":"test", "loWatermark":102400, "hiWatermark":409600}'
{
"errorCode": -199,
"returnValue": false,
"errorText": "DefineType: Type 'test' already exists."
}


DeleteType

Description

The DeleteType method allows you to delete a previously defined cache type and frees up its space. All objects in the cache must be expired in order to delete a cache type. The app can call the ExpireCacheObject to force the objects to expire in the cache type. 

Parameters

Name

Required

Type

Description

typeNameRequiredString

The typeName is the name of the cache type to be deleted

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: DeleteTypeReturn

Return number of freed space. See DeleteTypeReturn for details and examples of the success or failure of the method.

Example

luna-send -n 1 luna://com.webos.service.filecache/DeleteType '{"typeName":"test"}'
=>
{
"freedSpace": 8192,
"returnValue": true
}


DescribeType

Description

The DescribeType returns cache type details. The DescribeType will return the currently assigned values for all cache type parameters. 

Note: Filesize as it resides on disk after accounting for the filesystem blocksize of 4096  loWatermark/hiWatermark will be padded with filesystem block size of 4096.

Parameters

Name

Required

Type

Description

typeNameRequiredString

The typeName is the name of the cache type for which more information about the cache type is needed.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: DescribeTypeReturn

Return cache type details. See DescribeTypeReturn for details and examples of the success or failure of the method.

Example

luna-send -f -n 1 luna://com.DescribeType.filecache/DescribeType '{"typeName":"test"}'
=>

{
"cost": 0,
"hiWatermark": 413696,
"lifetime": 1,
"loWatermark": 106496,
"returnValue": true,
"size": 0
}


ExpireCacheObject

Description

Objects will normally be automatically expired form the cache as space is needed. If you want to force an item to be removed or if you want to remove items prior to calling DeleteType, you can expire an object manually.

The ExpireCacheObject method will not actually remove a subscribed object from the cache, but will mark the object for removal. The object is physically removed, when it has no active subscriptions.

NOTE: By default, objects in a cache type will be automatically expired from the cache as space is needed.

Parameters

Name

Required

Type

Description

pathNameRequiredString

Path of the object to be manually expired.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: CallReturn

Default object returned by methods. See CallReturn object for details and examples of the success or failure of the method.

Example

luna-send -n 1 luna://com.webos.service.filecache/ExpireCacheObject '{"pathName":"/var/file-cache/test/M/OnRpQABl.bar"}'
=>
{
"returnValue": true
}


GetCacheObjectFilename

Description

The GetCacheObjectFilename method allows you to query the original filename of a particular object in a cache type.  In order to get the cache object file name the app must specify the path name of the object.  

Parameters

Name

Required

Type

Description

pathNameRequiredString

Path of the object for which the filename is to be queried.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: GetCacheObjectFilenameReturn

Return original name of a file. See GetCacheObjectFilenameReturn for details and examples of the success or failure of the method.

Example

luna-send -n 1 luna://com.webos.service.filecache/GetCacheObjectFilename '{"pathName":"/var/file-cache/test/L/cvrKwABm.bar"}'
=>
{
"fileName": "foo.bar",
"returnValue": true
}


GetCacheObjectSize

Description

The GetCacheObjectSize method allows you to query a particular object size in a cache type. In order to get the cache object size, the app must specify the pathname of the object. 

Parameters

Name

Required

Type

Description

pathNameRequiredString

Path for the cache object to be queried for its size.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject array: GetCacheObjectSizeReturn

Return size of a cache object. See GetCacheObjectReturn for details and examples of the success or failure of the method.

Example

luna-send -n 1 luna://com.webos.service.filecache/GetCacheObjectSize '{"pathName":"/var/file-cache/test/L/cvrKwABm.bar"}'
=>
{
"returnValue": true,
"size": 1024
}


GetCacheStatus

Description

The GetCacheStatus method will give you the status of the cache as a whole. The GetCacheStatus will return:

  • the number of cache types defined
  • the total space used by the objects in all cache types
  • the number of objects in all cache types
  • the available space in the cache

Parameters

None

Call Returns

Name

Required

Type

Description

ReturnRequiredObject array: GetCacheStatusReturn

Cache status details. See GetCacheStatusReturn for details and examples of the success or failure of the method.

Example

luna-send -n 1 luna://com.webos.service.filecache/GetCacheStatus '{}'
=>
{
"availSpace": 98304,
"numObjs": 1,
"numTypes": 1,
"returnValue": true,
"size": 8192

}


GetCacheTypes

Description

The GetCacheType method returns an array of all defined cache types.

Parameters

None

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: GetCacheTypesReturn

Array of available cache types. See GetCacheTypesReturn for details and examples of the success or failure of the method.

Example

luna-send -n 1 luna://com.webos.service.filecache/GetCacheTypes '{}'
=>
{
"returnValue": true,
"types": ["test"]
}


GetCacheTypeStatus

Description

The GetCacheTypes method allows you to query the status of a particular cache type to obtain:

  • the total space used by the objects in the specified cache type
  • the number of objects in the specified cache type

Parameters

Name

Required

Type

Description

typeNameRequiredString

The name of the cache type for which the status information is to be retrieved.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: GetCacheTypeStatusReturn

Contains cache type status. See GetCacheTypeStatusReturn for details and examples of the success or failure of the method.

Example

luna-send -n 1 luna://com.webos.service.filecache/GetCacheTypeStatus '{"typeName":"test"}'
=>
{
"numObjs": 1,
"returnValue": true,
"size": 8192
}


GetVersion

Description

The GetVersion method returns the version of the File Cache API.

Parameters

None

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: GetVersionReturn

Version details. See GetVersionReturn for details and examples of the success or failure of the method.

Example

luna-send -n 1 luna://com.webos.service.filecache/GetVersion '{}'
=>
{
"returnValue": true,
"version": "1.0"
}


InsertCacheObject

Description

The InsertCacheObject inserts a new object of the specified type into the cache. The pathname parameter is required. It is stored with the object to ensure that the correct extension is provided, so that other module can choose a strategy to process this file (for example, choose the file viewer matching the extension).

Other parameters are optional. If not provided, the cache type default values defined are be used.

Returned is the path to the object in the cache. The subscribe setting should be set to true so that after the object is inserted you can write the file.

Parameters

Name

Required

Type

Description

typeNameRequiredString

The cache type of the object being inserted.

fileNameRequiredString

The filename is stored with the object and is used to ensure the correct extension is provided on the cache object. The filename will help any code, for example,  one that determines a file viewer, to operate correctly on a cached object file.

sizeOptionalNumber

The size is a value in bytes, should be greater than zero. Note that, size parameter is required, if type has no default size.

costOptionalNumber

The cost is a number between 1 and 100.

lifetimeOptionalNumber

The lifetime is value in seconds.

subscribeOptionalBoolean

Subscribe should be set to true so that after the object is inserted one can continues to make updates to the file.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: InsertCacheObjectReturn

Return path to cache object. See InsertCacheObjectReturn for details and examples of the success or failure of the method.

Example

luna-send -n 1 luna://com.webos.service.filecache/InsertCacheObject '{"typeName":"test", "fileName":"foo.bar", "size":1024, "subscribe":false}'
=>
{

"pathName": "/var/file-cache/test/M/OnRpQABl.bar",
"returnValue": true
}


ResizeCacheObject

Description

By calling the ResizeCache you can specify the size of the cached object after it is inserted into the cache. Call this method if the final size of the object, which is being inserted into the cache, is not known by the moment, when you call the InsertCacheObject method. In this case:

  1. Call the InsertCacheObject method specifying the best approximate object size you can guess.
  2. Then call the ResizeCacheObject method on a subscribed object, if the the object size grows out of the previously specified size.

If the object is larger than the specified size when the write operation is complete, the object will be automatically removed from the cache. If the object is smaller than the specified size, the recorded object size will be adjusted to the correct size.

Remark: it is not a good practice to just specify a larger than expected size though as this could cause other objects to be expired from the cache to make room for the specified size.

Parameters

Name

Required

Type

Description

pathNameRequiredString

The path of the object to be resized.

newSizeRequiredNumber

The new size of the object in bytes.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: ResizeCacheObjectReturn

New size of a file. See ResizeCacheObjectReturn for details and examples of the success or failure of the method.

Example

Example of a successful call:
# luna-send -f -n 1 luna://com.webos.service.filecache/ResizeCacheObject '{"newSize": 1024, "pathName": "/var/file-cache/test/H/LCWlwAJb.cat"}'
{

"newSize": 1024,
"returnValue": true
}

Example of a failed call:
# luna-send -f -n 1 luna://com.webos.service.filecache/ResizeCacheObject '{"newSize": 2048, "pathName": "/var/file-cache/test/H/LCWlwAJb.cat"}'
{
"errorCode": -194,
"returnValue": false,
"errorText": "ResizeCacheObject: Unable to resize object."
}


SubscribeCacheObject

Description

The SubscribeCacheObject method enables you to subscribe an object in the cache and hold a subscription to the object for the duration of your usage. An object cannot be expired from the cache while at least one subscription is active.

Parameters

Name

Required

Type

Description

pathNameRequiredString

The path for the object to be subscribed.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: SubscribeCacheObjectReturn

Subscription details. See SubscribeCacheObjectReturn for details and examples of the success or failure of the method.

Error References

Error Code

Error Text

Error Description

-200Required argument 'pathName' is absent or has invalid type

This error message implies that the required argument pathName is absent or has an invalid type.

-199Invalid object id derived from pathname.

This error message implies that the path indicated by pathName is incorrect or does not exist more and hence the object id derived from it is invalid.

-199'pathName': %pathName% no longer found in cache

This error message implies that %pathName% does not exist more.

-199Could not find object to match derived id.

This error message implies that the object attached to this id no longer exists.

Example

luna-send -n 1 luna://com.webos.service.filecache/SubscribeCacheObject '{"pathName": "/path/to/file.ext" }'
==>
{
"returnValue": true,
"subscribed": true
}


TouchCacheObject

Description

The TouchCacheObject method allows you to mark an object as recently used. This decreases the chances of the object from getting expired from the cache when the space is being reclaimed.

Parameters

Name

Required

Type

Description

pathNameRequiredString

path of the object to be marked as touched.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: CallReturn

return is a CallReturn object. The CallReturn object provides details and examples of the success or failure of the method.

Example

luna-send -n 1 luna://com.webos.service.filecache/TouchCacheObject '{"pathName":"/var/file-cache/test/D2_/aJQCH9.bar"}'
=>
{
"returnValue": true
}


Objects

CallReturn

Default object returned by methods. Some methods return custom data structures.

Example return value of a successful call: 

{
    "returnValue": true
}

Example return value of a failed call: 

{
    "errorCode" :-194,
    "errorText": "ResizeCacheObject: Unable to resize object.",
    "returnValue": false
}

Name

Required

Type

Description

returnValue Required Boolean

If the method succeeds returnValue will contain true.

If the method fails, returnValue will contain false and an error code and error message in the errorCode and errorText fields respectively.

errorCode Optional Number

If the method fails, it will return an error code number in errorCode

errorText Optional String

If the method fails, it will return an error message describing the reason for failure in errorText

CopyCacheObjectReturn

Object contains details about a file saved from a cache file. Contains filename of the created file. Contains error details(code and text) in case when call was unsuccessfull.

Example return value of a successful call: 

{
    "newPathName": "/media/internal/downloads/foo-(1).bar",
    "returnValue": true
}

Example return value of a failed call: 

{
     "errorCode": -199,
     "errorText": "CopyCacheObject: pathName no longer found in cache.",
     "returnValue": false
}

 

Name

Required

Type

Description

returnValue Required Boolean true if success, false if failure
newPathName Optional String

On success, the newPathName will be returned. This file name may be different than expected due to filename collisions. If there is a name collision, the name will be made unique by adding a number to the file basename (i.e. foo.bar may become foo-(1).bar).

errorCode Optional Number

Error code returned if returnValue is false, will not be returned if returnValue is true.

errorText Optional String

Error text returned if returnValue is false, will not be returned if returnValue is true.

DeleteTypeReturn

Object returned by the DeleteType Method. Contains freed memory size. Contains error details when call is unsuccessfull.

Example return value of a successful call: 

{
    "freedSpace": 8192,
    "returnValue": true
}

Example return value of a failed call: 

{
     "errorCode": -195,
     "errorText": "DeleteType: Type 'test' does not exist.",
     "returnValue": false
}

 

Name

Required

Type

Description

returnValue Required Boolean Returns true if success, false if it fails.
freedSpace Optional Number

Show the space freed by the cache being deleted on success.

errorCode Optional Number

Error code if returnValue is false, will not be sent if returnValue is true.

errorText Optional String

Error description if returnValue is false, will not be sent if returnValue is true.

DescribeTypeReturn

Object returned by the DescribeType method. Contains details about cache type. Contains error details, when call is unsuccessfull.

Example return value of a successful call: 

{
    "cost": 0,
    "hiWatermark": 413696,
    "lifetime": 1,
    "loWatermark": 106496,
    "returnValue": true,
    "size": 0
}

Example return value of a failed call: 

{
    "errorCode": -199,
    "errorText": "DescribeType: Type 'test' does not exists.",
    "returnValue": false
}

 

Name

Required

Type

Description

returnValue Required Boolean Returns true if success, false if it fails.
loWatermark Optional Number

The minimum space in bytes guaranteed to be available for this cache type.

hiWatermark Optional Number

The maximum space in bytes guaranteed to be available for this cache type.

size Optional Number

Default value in bytes for any object inserted into this cache type that does not specify a value for size.

cost Optional Number

Default value between 0 and 100 for any object inserted into this cache type that does not specify a value for cost.

lifetime Optional Number

Default value in seconds for any object inserted into this cache type that does not specify a value for lifetime.

errorCode Optional Number

Error code returned if returnValue is false, will not be returned if returnValue is true.

errorText Optional String

Error text returned if returnValue is false, will not be returned if returnValue is true.

GetCacheObjectFilenameReturn

Object returned by the GetCacheObjectFilename method. Contains original file name of a cached object. Contains error details if a call is unsuccessfull.

Example return value of a successful call: 

{
    "fileName": "foo.bar",
    "returnValue": true
}

Example return value of a failed call:  

{
    "fileName": "",
    "returnValue": true
}

 

Name

Required

Type

Description

returnValue Required Boolean Returns true if success, false if it fails.
fileName Optional String

Original filename of the specified object if the call succeeds.

errorCode Optional Number

Error code returned if returnValue is false, will not be returned if returnValue is true.

errorText Optional String

Error text returned if returnValue is false, will not be returned if returnValue is true.

GetCacheObjectSizeReturn

Object returned by the GetCacheObjectSize method. Contains size of a cahce object or error details if a call is unsuccessfull.

Example return value of a successful call:  

{
    "returnValue": true,
    "size": 1024
}

Example return value of a failed call:  

{
    "errorCode": -199,
    "errorText": "GetCacheObjectSize: Object '/var/file-cache/test/L/cvrKwABm.bar' doesn't exist",
    "returnValue": false
}

 

Name

Required

Type

Description

returnValue Required Boolean Returns true if success, false if it fails.
size Optional Number

Size of the specified object on success

errorCode Optional Number

Error code returned if returnValue is false, will not be returned if returnValue is true.

errorText Optional String

Error text returned if returnValue is false, will not be returned if returnValue is true.

GetCacheStatusReturn

Object returned by the GetCacheStatus method. Contains current state of a whole cache.

Example return value of a successful call:  

{
    "availSpace": 98304,
    "numObjs": 1,
    "numTypes": 1,
    "returnValue": true,
    "size": 8192
}

This call is always successful and hence returnValue will always be true.

Name

Required

Type

Description

numTypes Required Number The number of cached types defined
size Required Number The total space used by the objects in all cache types
numObjs Required Number

The number of objects in all cache types

availSpace Required Number The available space in the cache
returnValue Required Boolean

Always true

GetCacheTypesReturn

Object returned by the GetCacheTypes method. Contains list of exisitng cache types. Contains error details if a call was unsuccessfull.

Example return value of a successful call:  

{
    "returnValue": true,
    "types": ["test"]
}

 

This call is always successful and hence returnValue will always be true.

Name

Required

Type

Description

types Optional String array

Array of all defined cache types.

NOTE: If cache types are not defined, the “types” array is not returned.

returnValue Required Boolean

Always true

GetCacheTypeStatusReturn

Object returned by the GetCacheTypeStatus method. Contains status of specified cache type. Contains error details when call is unsuccessfull.

Example return value of a successful call:  

{
    "numObjs": 1,
    "returnValue": true,
    "size": 8192
}

Example return value of a failed call:  

{
    "errorCode": -199,
    "errorText": "GetCacheTypeStatus: Type 'test' doesn't exist",
    "returnValue": false
}

 

Name

Required

Type

Description

returnValue Required Boolean Returns true if success, false if it fails.
size Optional Number

The total space used by the objects in the specified cache type, if succeed

numObjs Optional Number

The number of objects in the specified cache type, if succeed.

errorCode Optional Number

Error code returned if returnValue is false, will not be returned if returnValue is true.

errorText Optional String

Error text returned if returnValue is false, will not be returned if returnValue is true.

GetVersionReturn

Object returned by the GetVersion method. Contains current version of API.

Example return value of a successful call:  

{
    "returnValue": true,
    "version": "1.0"
}

This call is always successful and hence returnValue will always be true.

Name

Required

Type

Description

version Required String File Cache API version.
returnValue Required Boolean

Always true

InsertCacheObjectReturn

Object returned by the InsertCacheObject method. Contains path to a newly created cache object. Contains error details if a call is unsuccessfull.

Example return value of a successful call:  

{
    "pathName": "/var/file-cache/test/M/OnRpQABl.bar",
    "returnValue": true
}

Example return value of a failed call:  

{
    "errorCode": -200,
    "errorText": "InsertCacheObject: No type 'test' defined.",
    "returnValue": false
}

 

Name

Required

Type

Description

returnValue Required Boolean Returns true if success, false if it fails.
pathName Optional String

The path to the object in the cache is returned on success.

subscribed Optional Boolean Returns true if the subscription has been successful, returns false if it fails. May not be returned if subscribe was set to false in the arguments.
errorCode Optional Number

Error code returned if returnValue is false, will not be returned if returnValue is true.

errorText Optional String

Error text returned if returnValue is false, will not be returned if returnValue is true.

ResizeCacheObjectReturn

Object returned by the ResizeCacheObject method. Contains new size of an object if a call is successfull, otherwie contains error details.

Example return value of a successful call:  

{
    "newSize": 4096, 
    "returnValue": true
}

Example return value of a failed call:  

{
    "errorCode": -199,
    "errorText": "ResizeCacheObject: pathName no longer found in cache.",
    "returnValue": false
}

 

Name

Required

Type

Description

returnValue Required Boolean Returns true if success, false if it fails.
newSize Optional Number

The new size of the resized object on success.

errorCode Optional Number

Error code returned if returnValue is false, will not be returned if returnValue is true.

errorText Optional String

Error text returned if returnValue is false, will not be returned if returnValue is true.

SubscribeCacheObjectReturn

Object returned by the SubscribeCacheObject method. Contains subscription details or error details if a call is unsuccessfull.  The subscription is cancelled automatically when LS call is cancelled or call originator is closed.

Example return value of a successful call:  

{
    "returnValue": true, 
    "subscribed": true
}

Example return value of a failed call:  

{
    "errorCode": -199,
    "errorText": "Invalid object id derived from pathname.",
    "returnValue": false
}

Name

Required

Type

Description

returnValue Required Boolean Returns true if success, false if it fails.
subscribed Required Boolean

Returns true if the subscription has been successful, otherwise false

errorText Optional String

Error text returned if returnValue is false, will not be returned if returnValue is true.

errorCode Optional Number

Error code returned if returnValue is false, will not be returned if returnValue is true.


Except as noted, this content is licensed under Creative Commons Attribution 4.0 and sample code is licensed under Apache License 2.0.