Discussions

Ask a Question
Back to All

Downloading Attachment files

I've seen a number of questions about using the Get Attachment (https://developer.servicem8.com/reference/get-attachment-single) answered by saying to change the .json to .file at the end of the URL (https://api.servicem8.com/api_1.0/attachment/71cb7-snipped-8a.file), but no matter what I try I can't seem to get the actual file downloaded - the initial response comes out as:

StatusCode : 200
StatusDescription : OK
Content : {255, 216, 255, 224…}
RawContent : HTTP/1.1 200 OK
x-amz-id-2: IRrZIUNzBkMWDkw
x-amz-request-id: MAG06K4JE6NNE7WJ
Date: Tue, 09 Jul 2024 08:30:49 GMT

Headers : {[x-amz-id-2, System.String[]], [x-amz-request-id, System.String[]], [Date, System.String[]], [x-amz-replication-status, System.String[]]…}
RawContentLength : 30236
RelationLink : {}

Attempting to pull the Content or RawContent data doesn't seem to yield the .jpg buried in all this, although when I paste the URL directly into a browser I can see the image so I can see it's there. I'm working in PowerShell, but have tried using curl with the same basic results.

Can someone please point me in the right direction?