The media is downloaded directly, so you should save the output to a file with an appropriate name.
HTTP Request
GET https://api.safetyculture.io/audits/<audit ID>/media/<media ID>
URL Parameters
Parameter Description
audit ID The ID of the audit to retrieve
media ID The ID of the media within the audit to retrieve
Response
The Content-Type will be the MIME type associated with the media, and the body of the response is the media itself.
Dim job As HttpJob
CUrl = "https://api.safetyculture.io"
Dim cPost ="/audits/audit_3ec7a77d89544c958c0c8e1a73157cd9/media/ad1133f5-dfd0-4b93-a61d-4f45fddfbd91" As String
cMedia = "2a5b04e7-d4ed-4de4-ba28-5d26e63e40b2.jpg"
job.Initialize("",Me)
job.PostString(CUrl, cPost)
job.GetRequest.SetContentType("image/jpeg")
job.GetRequest.SetHeader("authorization", "Bearer " & cIOToken)
Wait For (job) JobDone(job As HttpJob)
If job.Success Then
job.GetString()
End If
Dim cPost ="/audits/audit_3ec7a77d89544c958c0c8e1a73157cd9/media/ad1133f5-dfd0-4b93-a61d-4f45fddfbd91" As String
cMedia = "2a5b04e7-d4ed-4de4-ba28-5d26e63e40b2.jpg"
Dim cPost ="/audits/audit_3ec7a77d89544c958c0c8e1a73157cd9/media/2a5b04e7-d4ed-4de4-ba28-5d26e63e40b2" As String
cMedia = "2a5b04e7-d4ed-4de4-ba28-5d26e63e40b2.jpg"
I mean, trailing chars for CPost being the mediaID as shown in cMedia but without its extension.
Is there any chance that the SetHeader should be written like :
job.GetRequest.SetHeader("Authorization:", "Bearer " & cIOToken)
i.e. capital letter and eventually a trailing colon?
I'm not a curl expert, so others will be more useful here. Just spotted a couple of banal points that eventually could be the cause (not betting a dime on them).
Dim job As HttpJob
Dim Curl = "https://api.safetyculture.io" as String
Dim cPost ="/audits/audit_3ec7a77d89544c958c0c8e1a73157cd9/media/ad1133f5-dfd0-4b93-a61d-4f45fddfbd91" As String
' CUrl "https://api.safetyculture.io/audits/audit_01ca38a821504cda885736cccbb9ba40/media/9E3BD015-6275-4668-BAF1-296B2F38444C" \
' -o 9E3BD015-6275-4668-BAF1-296B2F38444C.jpg \
' -H "Authorization: Bearer ..."
job.Initialize("",Me)
job.Download(Curl & cPost )
job.GetRequest.SetHeader("authorization", "Bearer " & cIOToken)
Wait For (job) JobDone(job As HttpJob)
If job.Success Then
Log("good media retrieve")
Log(job.GetString)
End If
job.Release