Add/remove projects from project folders

How to add or remove a project from a project folder or simply modify your project folder.

Sandbox endpoint

https://api.platform.sandbox.easytranslate.com/api/v1/teams/:team_name/folders/:project_folder_id

In order to add, remove a project from your folder or update your project folder, you need to send a PATCH request. 

In your request's header, you need to add your access token, to do so, simply add "Authorization" as a key and "Bearer {{ACCESS_TOKEN}}" (instead of {{ACCESS_TOKEN}}, you should provide your access token). You also need to specify that json should be accepted. To do so, add "Accept" as a key and "application/json" as its value. 

You then need to add two variables to your endpoint path: 
    • Team_name: {{TEAM_NAME}} 
      Instead of {{TEAM_NAME}} in the request example below, you need to provide the team_name of your team. It can be retrieved from the api/v1/user endpoint.
    • Project_folder_id: {{PROJECT_FOLDER_ID}} 
      Instead of {{PROJECT_FOLDER_ID}} in the request example below, you need to provide the ID of the project folder you wish to update. 

Finally, you need to send the following data as part of the body of your request:

{
"data": {
"type": "project-folder",
"attributes": {
"name": "X-FORCE", // Optional
"included_project_ids": [
"{{PROJECT_ID}}"
],
"excluded_project_ids": [
"{{PROJECT_ID}}"
]
}
}
}

The fields included_project_ids and excluded_project_ids can be used with the PATCH HTTP method and they are not required at the same time. But those fields can never be empty.

 

Sandbox request example 

curl --location -g --request PATCH 'https://api.platform.sandbox.easytranslate.com/api/v1/teams/{{TEAM_NAME}}/folders/{{PROJECT_FOLDER_ID}}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--data-raw '{
"data": {
"type": "project-folder",
"attributes": {
"name": "X-FORCE", // Optional
"included_project_ids": [
"{{PROJECT_ID}}"
],
"excluded_project_ids": [
"{{PROJECT_ID}}"
]
}
}
}'

 

Sandbox response example

{
"data": {
"type": "project-folder",
"id": "27cf582a-9b22-41bf-a0ce-c9efefb66622",
"attributes": {
"name": "X-FORCE",
"total_projects": 2,
"created_at": "2020-08-27T08:38:23.000000Z",
"updated_at": "2020-08-27T08:38:23.000000Z"
},
"relationships": {
"projects": [
{
"id": "ef1e29b6-6dcf-424b-858f-aa7f75a3cf65",
"type": "project"
},
{
"id": "0cb8c2b2-a88c-44ac-b34e-5141a6b1921d",
"type": "project"
}
]
}
},
"included": [
{
"type": "project",
"id": "ef1e29b6-6dcf-424b-858f-aa7f75a3cf65",
"attributes": {
"name": "Application Form #1",
"customer_id": "56e9b95b-7892-4eda-b28e-0b8a7e52b4f3",
"source_language": "en",
"source_content": "https://api.platform.sandbox.easytranslate.com/api/v1/teams/deadpool/projects/ef1e29b6-6dcf-424b-858f-aa7f75a3cf65/download",
"file_name": "data.json",
"target_languages": [
"da",
"de"
],
"agent": "EasyTranslate Dashboard",
"price": {
"amount": 14526,
"amount_euro": 12272,
"total": 14526,
"total_euro": 12272,
"currency": "USD"
},
"payment": {
"date": "2020-08-27",
"method": "digital",
"amount": 14526,
"currency": "USD",
"vat_percent": 0.25,
"gross_amount": 18158,
"invoice_url": "https://pay.stripe.com/invoice/acct_19n4RfHbEySjdvVG/invst_HuVfvi1eU4LZeX1rQCLXwXJ5mBp2DXQ/pdf"
},
"status": "ASSIGNED",
"folder_id": "27cf582a-9b22-41bf-a0ce-c9efefb66622",
"folder_name": "X-FORCE",
"callback_url": null,
"progress": {
"percent": 0.5,
"completed_tasks": 1
},
"created_at": "2020-08-27T08:39:27.000000Z",
"updated_at": "2020-08-27T08:39:58.000000Z"
},
"relationships": []
},
{
"type": "project",
"id": "0cb8c2b2-a88c-44ac-b34e-5141a6b1921d",
"attributes": {
"name": "Updated Application Form #1",
"customer_id": "56e9b95b-7892-4eda-b28e-0b8a7e52b4f3",
"source_language": "en",
"source_content": "https://api.platform.sandbox.easytranslate.com/api/v1/teams/deadpool/projects/0cb8c2b2-a88c-44ac-b34e-5141a6b1921d/download",
"file_name": "data.json",
"target_languages": [
"da",
"de"
],
"agent": "EasyTranslate Dashboard",
"price": {
"amount": 14526,
"amount_euro": 12272,
"total": 14526,
"total_euro": 12272,
"currency": "USD"
},
"payment": {
"date": null,
"method": null,
"amount": 14526,
"currency": "USD",
"vat_percent": 0.25,
"gross_amount": 18158,
"invoice_url": null
},
"status": "PRICE_ACCEPTED",
"folder_id": "27cf582a-9b22-41bf-a0ce-c9efefb66622",
"folder_name": "X-FORCE",
"callback_url": null,
"progress": {
"percent": 0,
"completed_tasks": 0
},
"created_at": "2020-08-27T08:40:13.000000Z",
"updated_at": "2020-08-27T08:40:20.000000Z"
},
"relationships": []
}
],
"meta": {
"copyright": "Copyright 2020 EasyTranslate A/S",
"environment": "sandbox"
}
}