Documentation Center

Get online assets

Get a list of all the online assets on your system.

For security reasons, you need to perform a Login action before making any other public calls to the WorldServer API. The sessionId in the response is your session token. Use this token in all the other calls that you make.

Also, make sure that you have the appropriate user type permissions to perform this API call. To view or update your permissions, in WorldServer, go to Management > User Setup > User Types, and then select your user type.

API call

<protocol>://<ws-host>:<ws-port>/ws-api/v2/onlineAssets?token=<sessionId>

Details

  • GET method
  • Content-Type in the header: application/json
  • Mandatory parameter: the session token (as a query string parameter or as a key-value pair in the header)

Available filters

You can add the filters as query string parameters or as key-value pairs in the header:
FilterDescription
sortBy=<fieldName>If the fields you specified for sorting (for example, name or description) are not available, the results will not be sorted.
sortDirection=<asc|desc>Ascending or descending.
offset=<number>The zero-based starting index in the entire collection of the first item to return.
limit=<number>The maximum number of collection items to return for a single request. By default, 30. The limit should be greater than or equal to 1.
Examples:
  • <protocol>://<ws-host>:<ws-port>/ws-api/v2/onlineAssets?token=<sessionId>&offset=10&limit=7
  • <protocol>://<ws-host>:<ws-port>/ws-api/v2/onlineAssets?token=<sessionId>&sortBy=id&sortDirection=desc

Response

A screen shot that shows a typical response to this call.

Error messages

MessageStatus code
Limit not provided or invalid (Its value should be greater than or equal to 1.)400 Bad Request
Offset not provided or invalid (If the value is negative.)400 Bad Request
Offset out of range. Collection has only n items (If the offset value is greater than n.)400 Bad Request
No session token provided or invalid token401 Unauthorized