supportbee | Ruby client to work with Supportbee API | REST library
kandi X-RAY | supportbee Summary
kandi X-RAY | supportbee Summary
Ruby client to work with Supportbee API (
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- retrieves a list of models
- Perform HTTP request
supportbee Key Features
supportbee Examples and Code Snippets
Community Discussions
Trending Discussions on supportbee
QUESTION
I am trying to create an attachment using the Support Bee API as documented here: https://supportbee.com/api#create_attachment
I have written a service that uses an HttpClient
to create and send the request using a filename.
If I test in in Postman, it succeeds. I am using form-data
for the body and just selecting the file to upload from the UI:
It doesn't work when I try to upload it via my HttpClient
Service:
ANSWER
Answered 2020-Feb-12 at 15:15First, it's important to note that a 500 response is akin to an unhandled exception, i.e. it's a bug on their end and more or less impossible to know for sure what you did wrong. I would suggest reporting it to them and, although I'm not familiar with Support Bee, I would hope they have good support people who can help you troubleshoot. :)
But if you want to play the guessing game, I agree that subtle differences between your successful Postman call and your code are a good place to start. For that header, note that content
is the MultipartFormDataContent
. You actually want to set it on the StreamContent
object.
Also, look at the request headers Postman is sending and see if Content-Disposition
includes a filename
. You might need to add that to your code too, if the API is expecting it.
Here's how to do both:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install supportbee
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page