title: Deleting a file from a bucket
body: <p>I'm trying to delete an object from a bucket. Reading the docs it all sounds super simple, but I just can't seem to get it working.</p>
  
  <p>I'm following the instructions <a href="https://developer.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectName-DELETE/" rel="nofollow">here</a> to try and delete this object, which I can see using <code>https://developer.api.autodesk.com/oss/v2/buckets/my-persistent-bucket/objects</code>:</p>
  
  <pre><code>bucketKey =&gt; 'my-persistent-bucket'
          objectKey =&gt; '--test2.dwg'
          objectId =&gt; 'urn:adsk.objects:os.object:my-persistent-bucket/--test2.dwg'
          sha1 =&gt; '477085439a60779064d91fd1971d53c77c7a163a'
          size =&gt; (int) 188600
          location =&gt; 'https://developer.api.autodesk.com/oss/v2/buckets/my-persistent-bucket/objects/--test2.dwg' 
  </code></pre>
  
  <p>According to the docs we use this end point:</p>
  
  <pre><code>https://developer.api.autodesk.com/oss/v2/buckets/:bucketKey/objects/:objectName
  </code></pre>
  
  <p>Where </p>
  
  <p><code>:bucketKey</code> is url encoded <code>'my-persistent-bucket'</code></p>
  
  <p><code>:objectName</code> is url encoded <code>'urn:adsk.objects:os.object:my-persistent-bucket/--test2.dwg'</code></p>
  
  <p>I've tried using PHP's <code>urlencode()</code> and the following base64 encode function:</p>
  
  <pre><code>private function _base64url_encode($data) {
    return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
  }
  </code></pre>
  
  <p>to encode the <code>:bucketKey</code> and <code>:objectName</code> but no matter how I try to encode it I always get:</p>
  
  <pre><code>404 : Object not found
  </code></pre>
  
  <p>Could anyone help me understand where I'm going wrong?</p>
  
  <p>Thanks a lot</p>