Getting an 409 Conflict "path/no_write_permission" to team space when trying to upload a file. Where do I set team space folder persmissions for an app?
Here is the code (powershell):
$DonToken = 'zzzzzzzz'
$NameSpaceId = "9999999999"
$TargetFileDir = "ns:" + $NameSpaceId + "/TEAM1/TestDeploy/"
$InputZipPath = 'c:\temp\TestPushToDropBox.zip'
$ZipFileName = "TestPushToDropBox.zip"
$arg = '{ "path": "' + $TargetFileDir + $ZipFileName + '", "mode": "add", "autorename": true, "mute": false }'
$authorization = "Bearer " + $Token
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", $authorization)
$headers.Add("Dropbox-API-Arg", $arg)
$headers.Add("Content-Type", 'application/octet-stream')
# $nshead = '{".tag": "namespace_id", "namespace_id": $NameSpaceId}'
# $headers.Add("Dropbox-API-Path-Root", $nshead)
$resp = try {
Invoke-RestMethod -Uri https://content.dropboxapi.com/2/files/upload -Method Post -InFile $InputZipPath -Headers $headers
} catch {
$_.Exception.Response
}
write-host $resp.StatusCode.value__
write-host $resp.StatusCode
write-host $resp.StatusDescription