Documentation Center

Get attribute definitions

Get the list of attributes defined for the resource type 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.

API call

<protocol>://<ws-host>:<ws-port>/ws-api/v1/attributeDefinitions?token=<sessionId>&resourceType=<value>

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 resourceType (as a query string parameter)

The resourceType parameter can have one of the following values: VENDOR, PROJECT, TASK, USER, TM_TRANSLATION, TD_ENTRY, TD_TERM, WORKFLOW_ROLE, WORKGROUP, TM_GROUP, TD_GROUP, WORKFLOW, ISSUE, COST_MODEL, CLIENT, RFQ, REVIEW_MODEL, or TD_LANGUAGE.

Available filters

You can add the filters as query string parameters or as key-value pairs in the header:
FilterDescription
fields=<fieldName1,fieldName2,[...],fieldNameN>The names of the fields to be included in the JSON response, separated by commas. Do not use in conjunction with the excludedFields filter.
excludedFields=<fieldName1,fieldName2,[…],fieldNameN>The names of the fields to be excluded from the JSON response, separated by commas. Do not use in conjunction with the fields filter.
resourceIds=<id1,id2,[...],idN>The IDs of particular resources belonging to the resourceType you specified (for example, project IDs if the resource type is PROJECT or task IDs if the resource type is TASK).
Examples:
  • <protocol>://<ws-host>:<ws-port>/ws-api/v1/attributeDefinitions?token=<sessionId>&resourceType=PROJECT
  • <protocol>://<ws-host>:<ws-port>/ws-api/v1/attributeDefinitions?token=<sessionId>&resourceType=TASK&excludedFields=name,type

Response

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

Error messages

MessageStatus code
Required filter resourceIds not provided, or invalid (If one of the resource IDs that you entered is not a valid number.) 400 Bad Request
No session token provided or invalid token401 Unauthorized
Resource PROJECT (ID) not found404 Not Found
No enum constant com.sdl.lt.worldserver.model.attribute.ResourceType.<invalidResourceType> (If the resourceType that you entered is not valid.)500 Internal Server Error