Box.com - add box.com app to a specific folder - box-api

We have a client who is going to upload files to our box.com folder. As I understand I can use webhooks to trigger a POST request to my server as soon as someone uploads anything. Webhooks are setup inside box.com app that you need to create. This all makes sense. But how do I add my app to "monitor" that specific folder? Do I need to publish my app (I don't want to do that)? Thank you.

How do I add my app to "monitor" that specific folder?
When you configure the webhook for Upload events, you can specify that Box should include the ID (#item_parent_folder_id#) of the folder that received the upload. On the server you can use this ID to monitor for uploads to a specific folder. (This assumes you know the ID of the upload folder in advance, and it sounds like you do.)
Do I need to publish my app?
No, you don't need to publish the app.

Related

chrome.fileSystem on files/folders inside the app/extension

I am working on a Chrome App where I need the users to open files in a directory. For his own files, I can offer them a dialog through
chrome.fileSystem.chooseEntry
which works well. However that seems to limit me to the "Downloads" directory and Google Drive on my Chromebook. I would also like to ship some files with the application itself, so the files/folders would be located inside the app package. Is it possible to access these files through the fileSystem API?
I would not need the user to choose the files from a dialogue, it would be enough if I could get a handle to these files and offer to display them on the click of a button through my app.
Thanks in advance
You can read included files using chrome.runtime.getPackageDirectoryEntry(function(directoryEntry) {})

Upload files to a cloud storage folder using its shared link

Is it possible to upload files to a cloud storage folder for which I have only the shared link with edit permissions? I want to do this from my application, from code, so I'm interested in an API. I've looked into SkyDrive, GoogleDrive and DropBox APIs but I can't find a solution for this scenario in the API references.
It's fine if I have to sign in through the API with a user account to be able to upload the files to the shared link but I need to allow any user that has the link to upload files to that location.
Have I missed anything in the above mentioned APIs or are there any other cloud storage services which supply a solution for my needs?
Yes it is possible.
These are the steps I just took to verify.
User-A creates a folder called 'shared folder'
User-A makes that folder publicly writeable
User-A passes the shared URL to User-B. The key part of the URL is the id=1bxxxxxxx
User-B goes to https://developers.google.com/drive/v2/reference/files/insert#try-it
... where he authenticates himself
... creates a request body containing parent: "id_from_step_3"
... Executes the upload
The result is that User-B has created a file in the folder 'shared folder'
I think you have got your self in a tangle.
Through a shared URL
When someone gives you a URL to view and indeed edit a file that is purely for that file. You can't therefore upload files that way. You can share folders however very easily. https://support.google.com/drive/answer/2494822?hl=en https://www.dropbox.com/help/19/en
As for the API directly I can't really help you I am affraid

Is it possible to create a task using the box-api v2 in a folder?

I have successfully created tasks using the box-api v2 on files. However, I often need to create a task in a folder, e.g. for someone to upload a file to the folder, not simply review a file in that folder.
It doesn't appear to be possible now, is that true? if so, any plans to make that possible?
It's not possible to assign a task to a folder via the API or the Box web application. I don't believe Box has any current plans to add tasks either via the web or programmatically.
Rory

Access public dropbox files (via shared link) without user authentication

I'm trying to integrate Dropbox into my web application in the following way:
Users can enter a Dropbox Share Link, i.e. a Dropbox folder that can be accessed by anyone, even without a dropbox account.
My application then grabs the images from the folder and displays them to all users of my application.
Now as far as I can tell, the Dropbox API doesn't allow this without sending the user through a full-blown OAuth process. But since the shared link is public anyway, I don't need (and don't want) access to the users Dropbox account.
Is there a way to access a shared link in a programmatic way (without parsing the DOM or similar hacks)? Maybe there is a query parameter on the shared link to retrieve the contents as JSON? If it exists, I didn't find any docs about it.
Surely I'm not the first one to try this, so please share your solutions!
No, there's no programmatic way to list folder contents from a share link. If you have a share link for a specific file, then you can convert the domain from www.dropbox.com to dl.dropboxusercontent.com, but this trick doesn't work on folders.

Generate a URL for Google Drive publicly shared files and access them

I have a collection of PDF files on a Google Drive. I have shared them and I want to be able to link to them from a list on a web site. What I'd like to be able to do is work out the file name of the PDF using information in the list. As a simple example, if my list contains items 1, 2 and 3 I'd like to be able to upload PDF files 1.PDF 2.PDF and 3.PDF to Google Drive then have the web site just link to those when a link is clicked and show the PDF files in the browser.
So, I guess I could do this just by uploading the PDF to Google Drive and manually adding a link to PDF on the web site. However, what I want to do is generate the link programmatically so that when I have, say, 50 PDF files I don't have to keep getting the link from Google Drive and adding it to the web site. The site should just work out that item 50, say, in the list will link to 50.PDF, for example.
I've tried to get the file id using the API but that requires the authorization token to be generated and manual intervention to take place, so that won't work. At least, not at the point where the file is viewed because the viewer is anonymous.
So my questions are:
Is it possible to work out what a file name will be on the drive using just something like an item number in a list?
I guess that there are maybe some other options - for example, when I add the items to the list on the web site programmatically, I could go and locate the google drive file manually using a web application and link it using the file id at that point. I could store the ID in a database - however, would any anonymous user then be able to just click on the file link on the web site and view the file?
Finally, can anyone think of another way to do this?
Any help would be appreciated! :)
Is it possible for you to use a service account? You can authorize the app with an account dedicated to your app and user doesn't need to authorize and authenticate. The files you will be uploading will be managed under the service account's Drive.
You can learn more about service accounts on https://developers.google.com/accounts/docs/OAuth2ServiceAccount
If you have implementation specific questions, please ask.