Update projects
Update the settings of one or more projects, such as their due dates or their cost model.
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
Before you can update projects, you need to obtain the following information:
- The IDs of the projects that you want to update. To retrieve a list of all the available projects, make a GET call to the following endpoint and write down the appropriate project IDs in the response:
<protocol>://<ws-host>:<ws-port>/ws-api/v1/projects?token=<sessionId>
- The IDs and the source locales of the cost models that you want to use. To retrieve a list of all the available cost models, make a GET call to the following endpoint and write down the IDs and the source locales of the appropriate cost models:
<protocol>://<ws-host>:<ws-port>/ws-api/v1/costModels?token=<sessionId>
- The IDs of the quality models that you want to use. To retrieve a list of all the available quality models, make a GET call to the following endpoint and write down the appropriate quality model IDs in the response:
<protocol>://<ws-host>:<ws-port>/ws-api/v1/qualityModels?token=<sessionId>
API call
<protocol>://<ws-host>:<ws-port>/ws-api/v1/projects?token=<sessionId>
Details
- PATCH 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 project details
JSON body example for updating one project
In this case:
idis the ID of the project that you want to update.dueDateis the new due date that you want to set for this project.costModelis the new cost model that you want to set for this project. You need to specify at least the id and the source locale of the cost model.qualityModelis the new quality model that you want to set for this project. You need to specify at least the id of the quality model.
JSON body example for updating multiple projects
Response
Error messages
| Message | Status code |
|---|---|
| The cost model's source locale is different from project's source locale | 400 Bad Request |
| Field Id is not valid (If the ID of the cost model or of the quality model is invalid.) | 400 Bad Request |
| No session token provided or invalid token | 401 Unauthorized |
| QUALITY_MODEL (ID) not found (If you sent invalid quality model information in the request body.) | 404 Not Found |
| COST_MODEL (ID) not found (If you sent invalid cost model information in the request body.) | 404 Not Found |
| Null Pointer Exception (If you did not specify the source locale of the cost model in the request body.) | 500 Internal Server Error |
Troubleshooting
- Make sure that the endpoint you are calling is correct.
- Make sure that you are using the PATCH 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.
- In case you get an error message that indicates an invalid field, make sure you are using valid query parameters and values.