Documentation Center

Get downloadable assets

Check which assets you can download for the resources of your choice.

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.

Prerequisites

To get the downloadable assets, you need to find out the IDs of the resources to which those assets belong. For example, if the assets belong to tasks, you need to make a GET call to the /tasks endpoint.

API call

<protocol>://<ws-host>:<ws-port>/ws-api/v2/files/assets/verify?token=<sessionId>&resourceIds=<resourceId1,resourceId2>

Details

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

Available filters

You can add the filters as query string parameters or as key-value pairs in the header:
FilterDescription
assetLocationType=<value>One of SOURCE, TARGET, or SOURCE_TARGET. The default value is SOURCE.
resourceType=<value>One of TASK, PROJECT, or PROJECT_GROUP. The default value is TASK.
Examples:
  • <protocol>://<ws-host>:<ws-port>/ws-api/v2/files/assets/verify?token=<sessionId>&resourceIds=<resourceId1,resourceId2>&assetLocationType=SOURCE
  • <protocol>://<ws-host>:<ws-port>/ws-api/v2/files/assets/verify?token=<sessionId>&resourceIds=<resourceId1,resourceId2>&resourceType=PROJECT

Response

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

Error messages

MessageStatus code
Source asset is not available for download (If resourceType=TASK, but at least one of the resourceIds is not the ID of a task.)400 Bad Request
No session token provided or invalid token401 Unauthorized
Resource PROJECT_GROUP (ID) not found (If resourceType=PROJECT_GROUP, but at least one of the resourceIds is not the ID of a project group.)404 Not Found
Resource PROJECT (ID) not found (If resourceType=PROJECT, but at least one of the resourceIds is not the ID of a project.)404 Not Found
Internal Server Error:
  • If the value of one or more resourceIds is not a number.
  • If the value of the assetLocationType is not SOURCE, TARGET, or SOURCE_TARGET.
  • If the value of the resourceType is not PROJECT, TASK, or PROJECT_GROUP.
500 Internal Server Error