Endpoint:/sites/{siteId}/awe-tasks/{aweTaskID}

Note: Available as of EFT 8.1.0

Returns advanced workflow task from specified site (GET), updates advanced workflow task settings (PATCH), and deletes advanced workflow task (DELETE).

  • GET

  • PATCH

  • DELETE

Method & URL

GET https://{{host}}/admin/v2/sites/{{SiteId}}/awe-tasks/{aweTaskID}

GET Body Sample

Copy
### GET A SPECIFIC AWE TASK
@aweID = {{aweList.response.body.$.data[0].id}}
GET https://{{host}}/admin/v2/sites/{{Siteid}}/awe-tasks/{{aweID}} HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
###

GET Response Body Sample

Copy
{"data":{"id":"0f340ef3-3628-5844-bb6b-c659252b6b44","type":"aweTask","attributes":
{"name":"Sample - Date Format Functions","created":"2022-08-01","description":"",
"useTimeout":true,"timeout":120,"logLevel":"None","logDirectory":
"C:\\ProgramData\\Globalscape\\EFT Server\\AWE\\Temp\\","retainSuccessfulLogs":true,
"retainFailedLogs":true,
"code":"PEFNVEFTSz4NCjxBTVRBU0tIRUFEPg0KICAgIDxUQVNLSU5GTyBUQVNLVkVSU0lPTj0iMTAuNy4xMDAuMSIgLz4NC...},
"relationships":{"aweFolder":{"data":{"id":"00000000-0000-0000-0000-000000000000","name":"<root>"}}},
"links":{"self":
"/admin/v2/sites/b65892e9-399d-4447-a3b1-477c08f0abca/awe-tasks/0f340ef3-3628-5844-bb6b-c659252b6b44"}},
"links":{"self":"/admin/v2/sites/b65892e9-399d-4447-a3b1-477c08f0abca/awe-tasks"}}

GET PowerShell Sample

Copy
# get awe-tasks
Write-Output "AWE-TASKS"
Write-Output "-----"
$aweList = Invoke-RestMethod -Uri 
"$baseURL/v2/sites/$siteID/awe-tasks" 
-Method 'GET' -Headers $authHeader
Write-Output $aweList | ConvertTo-Json
foreach ($awetask in $aweList.data)
{
    Write-Output ("Task ID $($aweTask.id): Name -> 
    $($aweTask.attributes.name)")
}

$aweID = $aweList.data[0].id
$awsList = Invoke-RestMethod -Uri 
"$baseURL/v2/sites/$siteID/awe-tasks/$aweID" 
-Method 'GET' -Headers $authHeader
Write-Output $awsList | ConvertTo-Json

Method & URL

PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/awe-tasks/{{aweID}}

PATCH Body Sample

Copy
### UPDATE A SPECIFIC AWE TASK (this is using the environment var code)
### for your site you may have to adjust the index number
@aweID = {{aweList.response.body.$.data[14].id}}
PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/awe-tasks/{{aweID}} ]
TTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
{
  "data": {
    "type": "aweTask",
    "attributes": {     
      "logDirectory": "C\\temp\\"
    }
  }
}
###

PATCH Response Body Sample

Copy
{"data":
{"id":"8405b064-aa9a-46b8-b0b5-4c60eb3d3e09","type":"aweTask","attributes":
{"name":"MyNewAWEScript","created":"2022-08-01","description":"Hello, world!",
"useTimeout":true,"timeout":10,"logLevel":"Verbose","logDirectory":"C\\temp\\",
"retainSuccessfulLogs":false,"retainFailedLogs":true,"code":"PEFNVEFTSz4NCjxBTVRBU...="},
"relationships":{"aweFolder":{"data":{"id":"00000000-0000-0000-0000-000000000000","name":"<root>"}}},
"links":{"self":"/admin/v2/sites/b65892e9-399d-4447-a3b1-477c08f0abca/awe-tasks/
8405b064-aa9a-46b8-b0b5-4c60eb3d3e09"}},
"links":{"self":"/admin/v2/sites/b65892e9-399d-4447-a3b1-477c08f0abca/awe-tasks"}}

PATCH PowerShell Sample

Copy
##PATCH SITE AWE TASKS
Write-Output "Site specific AWE TASK PATCH"
Write-Output "-----"
$update = 
'{
  "data": {
    "type": "aweTask",
    "attributes": {     
      "description": "Well Hello",
      "useTimeout": true,
      "timeout": 10,
      "logLevel": "Verbose",
      "retainSuccessfulLogs": true,
      "retainFailedLogs": true
    }
  }
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 10
$patchAWETASKReturn = Invoke-RestMethod -Uri 
"$baseURL/v2/sites/$siteID/awe-tasks/$aweID" 
-Method 'PATCH' -Headers $authHeader -Body $update
Write-Output $patchAWETASKReturn | ConvertTo-Json 

Method & URL

DELETE https://{{host}}/admin/v2/sites/{{Siteid}}/awe-tasks/{{aweID}}

DELETE Body Sample

Copy
### DELETE A SPECIFIC AWE TASK
@aweID = {{aweList.response.body.$.data[0].id}}

DELETE https://{{host}}/admin/v2/sites/{{Siteid}}/awe-tasks/{{aweID}} HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
###

DELETE Response Body Sample

Copy
HTTP/1.1 204 No Content
Date: Mon, 01 Aug 2022 21:16:00 GMT
Content-Length: 0
Cache-Control: no-cache, no-store, must-revalidate
Expires: -1
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' data:;
Referrer-Policy: no-referrer

DELETE PowerShell Sample

Copy
$aweID = $aweList.data[0].id
$awsList = Invoke-RestMethod -Uri 
"$baseURL/v2/sites/$siteID/awe-tasks/$aweID" -Method 'DELETE' -Headers $authHeader
Write-Output $awsList | ConvertTo-Json