<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: File upload 409 Conflict  &amp;quot;path/no_write_permission&amp;quot; to team space in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-upload-409-Conflict-quot-path-no-write-permission-quot-to/m-p/306386#M18464</link>
    <description>&lt;P&gt;What's in the response body for the 400? It should contain a more helpful error message.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Oct 2018 20:50:15 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2018-10-30T20:50:15Z</dc:date>
    <item>
      <title>File upload 409 Conflict  "path/no_write_permission" to team space</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-upload-409-Conflict-quot-path-no-write-permission-quot-to/m-p/306361#M18461</link>
      <description>&lt;P&gt;Getting an&amp;nbsp;409 Conflict&amp;nbsp; "path/no_write_permission" to team space when trying to upload a file.&amp;nbsp; &amp;nbsp; Where do I set team space folder persmissions for an app?&lt;BR /&gt;&lt;BR /&gt;Here is the code (powershell):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;$DonToken = 'zzzzzzzz'&lt;BR /&gt;$NameSpaceId = "9999999999"&lt;BR /&gt;$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&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:09:35 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-upload-409-Conflict-quot-path-no-write-permission-quot-to/m-p/306361#M18461</guid>
      <dc:creator>dc_ucw</dc:creator>
      <dc:date>2019-05-29T09:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: File upload 409 Conflict  "path/no_write_permission" to team space</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-upload-409-Conflict-quot-path-no-write-permission-quot-to/m-p/306374#M18462</link>
      <description>&lt;P&gt;To access the team space itself, you need to set your "root" to the&amp;nbsp;team space using the "Dropbox-API-Path-Root" header, instead of specifying the namespace ID in the path value as you're trying to do in this code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can find information setting "root" in "Dropbox-API-Path-Root" in &lt;A href="https://www.dropbox.com/developers/reference/namespace-guide" target="_blank"&gt;the Namespace Guide&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;It looks like you have part of this commented out already. Re-enable that, and use "root" instead of "namespace_id", and remove the "ns:..." usage from your "path" value.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 20:29:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-upload-409-Conflict-quot-path-no-write-permission-quot-to/m-p/306374#M18462</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-10-30T20:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: File upload 409 Conflict  "path/no_write_permission" to team space</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-upload-409-Conflict-quot-path-no-write-permission-quot-to/m-p/306376#M18463</link>
      <description>&lt;P&gt;Greg - thanks for the quick reply.&amp;nbsp; &amp;nbsp; I have tried your suggestion, but now get a 400 "Bad Request"&lt;/P&gt;&lt;PRE&gt;$Token = 'zzzzzzzz'
$NameSpaceId = "9999999999"

$TargetFileDir = "/UCWorkspace/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": "root", "root": $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&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Oct 2018 20:39:35 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-upload-409-Conflict-quot-path-no-write-permission-quot-to/m-p/306376#M18463</guid>
      <dc:creator>dc_ucw</dc:creator>
      <dc:date>2018-10-30T20:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: File upload 409 Conflict  "path/no_write_permission" to team space</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-upload-409-Conflict-quot-path-no-write-permission-quot-to/m-p/306386#M18464</link>
      <description>&lt;P&gt;What's in the response body for the 400? It should contain a more helpful error message.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 20:50:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-upload-409-Conflict-quot-path-no-write-permission-quot-to/m-p/306386#M18464</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-10-30T20:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: File upload 409 Conflict  "path/no_write_permission" to team space</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-upload-409-Conflict-quot-path-no-write-permission-quot-to/m-p/306395#M18465</link>
      <description>&lt;P&gt;Yes, that would help wouldn't it?&amp;nbsp; Anyways it was a JSON error.&amp;nbsp; I fixed it - the upload works well now.&amp;nbsp; Thanks for the help - much appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 20:59:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-upload-409-Conflict-quot-path-no-write-permission-quot-to/m-p/306395#M18465</guid>
      <dc:creator>dc_ucw</dc:creator>
      <dc:date>2018-10-30T20:59:55Z</dc:date>
    </item>
  </channel>
</rss>

