Create project groups with custom File attributes from an existing project group

Create project groups that use the same custom File attributes as an existing project group.

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 create a project group from scratch, you need the following:
  • The ID of the project type that you will use for your new project group.
  • The ID of the client that you will use for your new project group.
  • The internalName of each asset that you want to translate as part of the project group.
  • The IDs of the locales that you will use for your new project group.
You can obtain these details by making the calls mentioned as related links at the end of this topic.

API call

http://<ws-host>:<ws-port>/ws-api/v1/projectGroups/createFromExisting?token=<sessionId>

Details

  • POST method
  • The internalName generated when uploading the file is required in the body of the request.
  • 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)
    • a JSON body with the following mandatory details: name (the name of the project group that you want to create), projectTypeId (the ID of the project type on which the newly created project group will be based), clientId (the ID of the client that you will use for the project group), systemFiles (the assets of the project group), locales (the IDs of the locales that you will use for the project group)
  • Optional parameter: expandZip—If you set it to true and you uploaded a .zip file, WorldServer automatically extracts the assets included in the .zip file.

JSON body example

A screen shot that shows a possible JSON body for this call.

Response

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

Error messages

MessageStatus code
Invalid JSON400 Bad Request
Could not process the given file (Make sure the file was already uploaded as an asset.)400 Bad Request
Field name not set (Minimum 3 characters.)400 Bad Request
Field projectTypeId not set400 Bad Request
Field Id is null (The client ID is mandatory.)400 Bad Request
Resource LOCALE (ID) not found400 Bad Request
The provided due date selected for the projects is in the past400 Bad Request
Locales should be presented with a non-empty value400 Bad Request
Project Type is not assigned to the Client400 Bad Request
User is not a member of the client (Make sure that the user belongs to the specified client.)400 Bad Request
No session token provided401 Unauthorized
No rights to WRITE for resource type PROJECT403 Forbidden
Resource CLIENT (ID) not found404 Not Found
Resource PROJECT_TYPE (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.
  • Project group creation depends on project types, clients, and users. Make sure that the information you specify is valid (for example, the project type should be assigned to the client and the user should be a member of the client).