Custom Connector - Box File Upload API - Post form data
All
I'm looking to extend the Box APIs through a custom connector. I know Workato provides a Box connector already but it doesn't meet my requirements so I'm learing the workato SDK while building out the capability I'm looking for.
The Box file upload API is causing me some problems as it requires the data to be submitted as form data and I can't find any reference in the documentation on how to do this.
The Box API reference is here ( although I have a sneaking feeling it's not correct as it doesn't match the working cURL statement above )
Support have said appending .request_format_multipart_form posts form data, but I'm still seeing a payload as one json object in the Network details of the error that's thrown back ( 400 bad request )
The standard Workato connect manages this API really nicely, so I know it's possible.
Anyone built a SDK connector with form data posted ?
Thanks in advance.
Best Answer
C
Chandra Vippena
said
over 7 years ago
Hello
Sorry for delayed response.
Hope the below code snippet helps. You can add File type as explicitly in the action parameters.
AtlasIdentity
Custom Connector - Box File Upload API - Post form data
All
I'm looking to extend the Box APIs through a custom connector. I know Workato provides a Box connector already but it doesn't meet my requirements so I'm learing the workato SDK while building out the capability I'm looking for.
The Box file upload API is causing me some problems as it requires the data to be submitted as form data and I can't find any reference in the documentation on how to do this.
A working cURL statement is as follows;
curl https://upload.box.com/api/2.0/files/content -H "Authorization: Bearer somebearertokendata" -H "Content-Type: multipart/form-data" -X POST -F attributes='{"name":"tigers.jpeg", "parent":{"id":"0"}}' -F file=@test.txt
The Box API reference is here ( although I have a sneaking feeling it's not correct as it doesn't match the working cURL statement above )
Support have said appending .request_format_multipart_form posts form data, but I'm still seeing a payload as one json object in the Network details of the error that's thrown back ( 400 bad request )
The standard Workato connect manages this API really nicely, so I know it's possible.
Anyone built a SDK connector with form data posted ?
Thanks in advance.
Hello
Sorry for delayed response.
Hope the below code snippet helps. You can add File type as explicitly in the action parameters.
Chandra Vippena
Hello
Sorry for delayed response.
Hope the below code snippet helps. You can add File type as explicitly in the action parameters.