Documentation Center

Create a project for moving tasks

Create an empty project, in which you will be able to move one or more tasks. The project will use the settings of an existing task 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

Before you can move tasks to a new project, you need to obtain the following information:
  • The ID of a task that you want to move, so that the project can have the same language pair. To retrieve a list of list of all the available tasks, make a GET call to the following endpoint and write down the appropriate task ID in the response:

    <protocol>://<ws-host>:<ws-port>/ws-api/v1/tasks?token=<sessionId>

  • The ID of the workgroup to which you want to assign the new project. To retrieve a list of all the available workgroups, make a GET call to the following endpoint and write down the appropriate workgroup ID in the response:

    <protocol>://<ws-host>:<ws-port>/ws-api/v1/workgroups?token=<sessionId>

API call

<protocol>://<ws-host>:<ws-port>/ws-api/v1/projects/createForTask?token=<sessionId>

Details

  • POST 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 JSON body with the details of the project

Request body example

A screen shot that shows a typical request body for this call. It includes the task ID, the name of the new project, the description of the new project, and the workgroup it will be assigned to.

In this example:
  • id is the ID of the task that you want to move to the project.
  • name is the name of the empty project that you want to create.
  • description is a short description of the project that you want to create.
  • workgroupId is the ID of the workgroup assigned to work on the new project.

Response

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

The value of the response property is the ID of the newly created project.

What to do next

Write down the ID of the newly created project and move the appropriate tasks to that project.

Error messages

MessageStatus code
Invalid JSON400 Bad Request
Field name not set400 Bad Request
Field id not set400 Bad Request
Field workgroupId not set400 Bad Request
No session token provided401 Unauthorized
Resource TASK (ID) not found404 Not Found
Resource WORKGROUP (ID) not found404 Not Found

Troubleshooting

  • Make sure that the endpoint you are calling is correct.
  • Make sure that you are using the POST method for the call.
  • Make sure that the Content-Type in the header is application/json.
  • Make sure that your session token is correct and that it has not expired.
  • Make sure that you included all the required information (id, name, description, workgroupId) in the JSON body.