Skip to content

Commit

Permalink
Merge pull request #103 from Ilhasoft/fix/file-endpoint-zendesk
Browse files Browse the repository at this point in the history
Fix file endpoint for Zendesk
  • Loading branch information
Robi9 authored Dec 27, 2022
2 parents dc717b9 + d62e3f0 commit 1d9c6b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion services/tickets/zendesk/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func (s *service) convertAttachments(attachments []utils.Attachment) ([]string,
path := strings.TrimPrefix(u.Path, prefix)
path = strings.TrimPrefix(path, "/")

fileURLs[i] = "file/" + path
fileURLs[i] = "api/v2/file/" + path
}
return fileURLs, nil
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
POST /api/v2/any_channel/push.json HTTP/1.1
Host: nyaruka.zendesk.com
User-Agent: Go-http-client/1.1
Content-Length: 409
Content-Length: 416
Authorization: Bearer ****************
Content-Type: application/json
Accept-Encoding: gzip

{"instance_push_id":"1234-abcd","request_id":"sesame:1570461700000000000","external_resources":[{"external_id":"ca5607f0-cba8-4c94-9cd5-c4fbc24aa767","message":"It's urgent","thread_id":"59d74b86-3e2f-4a93-aece-b05d2fdcde0c","created_at":"2019-10-07T15:21:39Z","author":{"external_id":"6393abc0-283d-4c9b-a1b3-641a035c34bf","name":"Cathy"},"allow_channelback":true,"file_urls":["file/0123/attachment1.jpg"]}]}
{"instance_push_id":"1234-abcd","request_id":"sesame:1570461700000000000","external_resources":[{"external_id":"ca5607f0-cba8-4c94-9cd5-c4fbc24aa767","message":"It's urgent","thread_id":"59d74b86-3e2f-4a93-aece-b05d2fdcde0c","created_at":"2019-10-07T15:21:39Z","author":{"external_id":"6393abc0-283d-4c9b-a1b3-641a035c34bf","name":"Cathy"},"allow_channelback":true,"file_urls":["api/v2/file/0123/attachment1.jpg"]}]}

0 comments on commit 1d9c6b0

Please sign in to comment.