0

I have a problem with attaching a file to a specific item using Java API. I know it should be possible as this functionality described here in the Podio documentation https://developers.podio.com/doc/files/attach-file-22518 and examples for PHP and Ruby are given. However I cannot find such method in the podio java library. I could find in FileAPI just methods that provide uploading files, but not attaching them to specific objects as described in documentation. I use Podio APi version 0.7.1

Any ideas how it should be done in Java?

Anders Abel
  • 67,989
  • 17
  • 150
  • 217
lilin
  • 29
  • 5

1 Answers1

0

Podio uses a REST-Style API. You send standard http-request, and you get back json-formatted data. So you can do it all without a special library for your programming language.

If there is no predefined java class for you, you can just do the call yourself. In the end it is just a HTTP-call.

From the ruby implemention, I see that you attach the file as multipart/form-data, so it is the same a browser would do it. There should be http-handling java classes to help you.

You also need to add the information from the API-Page, like the POST-Parameters and of course the url. The most difficult part is probably the authentication headers, but you need to solve this problem only once.

Meier
  • 3,858
  • 1
  • 17
  • 46
  • Sorry, i am new to Web services as well. When do you make such POST, how do you specify the object you want to attach this file to? As I understood its going to look something like this https://api.podio.com:443/file/{file_id}/attach. or I am wrong? – lilin Mar 07 '14 at 07:47
  • yes, but you need additional the parameters from the "request-section" of the api-documentation. it is ref_type and ref_id. I suggest to look up the source of other podio java api post methods, to find how the parameters are added. – Meier Mar 07 '14 at 10:02