/
library_resource_get ()

library_resource_get ()

Function prototype

library_resource_get (session, resource_id)

API Version

2.6.20 and higher

Supported interfaces

SOAP, REST (since API Version 2.7.29)

Description

returns the contents of a LIBRARY RESOURCE object.

Note that this function can be used for small objects (up to 512.000 bytes). If the resource referenced is bigger than the maximum allowed, an error will be returned and library_resource_get_stream () should be used instead

Required permissions: The active user must have role XXXX. Otherwise an INSUFFICIENT_PRIVILEGES error will be returned.

Input parameters:

Output parameters:

  • result: contents of the LIBRARY RESOURCE OBJECT

  • ErrorMsg: If any error occurs, then this value contains a description of the error translated to the current language

  • ErrorCode: If any error occurs, then this value contains any of the standard ERROR CODES

Request example

library_resource_get ( “LCAAAAAAAAAAAA”, 344);

Response

The response format is XML when the function has been invoked via the SOAP API, and JSON when it has been invoked via the REST API

Return Error codes

ERROR CODE

 

ERROR CODE

 

INVALID_TOKEN

The session token provided is not valid

INSUFFICIENT_PRIVILEGES

The session user does not have the necessary privileges to use the requested resource

LIBRARY_RESOURCE_NOT_FOUND

The LIBRARY RESOURCE reference provided does not correspond to an existing resource

LIBRARY_RESOURCE_TOO_LARGE

The requested resource is too large and should be downloaded using streaming. See library_resource_get_stream ()



Related content