Download Notes Attachments via Rest API Fails , document is empty

Hi All, 

I hope you guys have an idea why this is happing, am using  Guzzle to download Notes attachments but the attachment are  empty and I also getting the error 404 even when the document does exists. 

Here is the sample code.

$url = sprintf("%s/%s/file/filename"
                , $this->getRestUri()
                , $data['id']
            );
            $file_name = sprintf("%s/%s", _DOWNLOAD , $data['filename']);
            $getDocument = $this
                ->call(['headers' =>
                    [
                        'OAuth-Token' => "{$this->getToken()}"
                    ]
                ])->get($url, ['sink' => $file_name]);

Error: Client error:

`GET https://{URL}/rest/v11/Notes/40be29ba-bb8e-11ef-97ac-06768054a1d0/file/filename` resulted in a `404 Not Found` response:

{"error":{},"error_message":"File information could not be retrieved for this record"}

Parents Reply Children
No Data