REST API - post PDF to a board
How would I use the REST API to post a PDF file or attachment to a board? I'm new to this. We would like to put daily reports up for our members to view. I also need to find out how to get the ID or key for a board so that I can use the methods of the Board class. I've tried using the "id" method with the title of the board, but that gives me an error code 101 with the message "no board with the specified key". I think this is commonly done but I can't find any posts about either of these topics. Maybe I'm missing some important documentation? I'm coding in Java and have been through the RESTAPI_Javadocs but there seem to be some missing links. Thanks in advance for any advice!
Hi kwlange,
While there is a REST API method to upload an image (check out the images/upload method in the Album class), there unfortunately does not seem to be a similar method for other types of attachments. This has been suggested in the past (http://lithosphere.lithium.com/t5/Suggest-Your-Ideas/REST-API-support-for-images-or-attachments/idi-p/3355), but it doesn't seem to have gained a lot of support. If this is something you're interested in, definitely Kudo that idea and add any additional feedback you have. Perhaps this topic will raise support for it as well.
Perhaps as an alternative you could post a text and/or image version of the report?
Regarding the board id, this is the same id that was chosen when creating the board. One of the easiest ways to find the id for a particular board is to browse to the front page of the board and observe the portion of the URL after "bd-p". For example:
http://lithosphere.lithium.com/t5/Lithium-Developers/bd-p/studio
Thus, the board id for this board is "studio".
I hope this helps!