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 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
internalNameof 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.
API call
http://<ws-host>:<ws-port>/ws-api/v2/projectGroups/createFromExisting?token=<sessionId>
Details
- POST method
- The
internalNamegenerated 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
trueand you uploaded a .zip file, WorldServer automatically extracts the assets included in the .zip file.
JSON body example
Response
Error messages
| Message | Status code |
|---|---|
| Invalid JSON | 400 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 set | 400 Bad Request |
| Field Id is null (The client ID is mandatory.) | 400 Bad Request |
| Resource LOCALE (ID) not found | 400 Bad Request |
| The provided due date selected for the projects is in the past | 400 Bad Request |
| Locales should be presented with a non-empty value | 400 Bad Request |
| Project Type is not assigned to the Client | 400 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 provided | 401 Unauthorized |
| No rights to WRITE for resource type PROJECT | 403 Forbidden |
| Resource CLIENT (ID) not found | 404 Not Found |
| Resource PROJECT_TYPE (ID) not found | 404 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).