Get files saved as attribute values
Get the contents of the files saved as attribute values.
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 and then select your user type.
Prerequisites
To get the files saved as attribute values, you need the internal names of the files. These values were displayed as part of the response when you uploaded the file:

API call
<protocol>://<ws-host>:<ws-port>/ws-api/v1/files/attachments?token=<sessionId>&filename=<filename>
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 filename (as a query string parameter)
Available filters
You can add the filters as query string parameters or as key-value pairs in the header:
| Filter | Description |
|---|---|
| resourceType=<value> | One of TASK, PROJECT, or PROJECT_GROUP. The default value is TASK. |
| resourceId=<value> | The ID of the resource to which the file is attached. |
| attributeName=<value> | The name of the attribute to which the file is attached. |
| downloadToken=<token> | The token returned in the response after uploading the asset (if the asset is not attached to the resource). |
Examples:
- <protocol>://<ws-host>:<ws-port>/ws-api/v1/files/attachments?token=<sessionId>&filename=attr1113-8493849188859715237_ws_api.txt&resourceType=PROJECT
- <protocol>://<ws-host>:<ws-port>/ws-api/v1/files/attachments?token=<sessionId>&filename=attr1113-8493849188859715237_ws_api.txt&resourceId=3486&attributeName=attachment&resourceType=PROJECT
Response
The contents of the requested attribute files.
Error messages
| Message | Status code |
|---|---|
Source asset is not available for download (If resourceType=TASK, but the value of the resourceId is not the ID of a task.) | 400 Bad Request |
| No session token provided or invalid token | 401 Unauthorized |
Resource PROJECT_GROUP (ID) not found (If resourceType=PROJECT_GROUP, but the value of the resourceId is not the ID of a project group.) | 404 Not Found |
Resource PROJECT (ID) not found (If resourceType=PROJECT, but the value of the resourceId is not the ID of a project.) | 404 Not Found |
Internal Server Error:
| 500 Internal Server Error |