Can I use a Valence Learning Framework API to upload data into another LE user's locker?
Currently, you cannot; lockers are explicitly intended to be user-private storage spaces for Learning Environment users. Accordingly, the Valence Learning Framework APIs do not provide a way for calling user to upload data to another user's locker.
Related
I'm really struggling here as I'm super new to Dot Net Core as well as Google Cloud Storage. I have looked over a lot of the available documentation online but I still can't understand on how to build the architecture.
So what I'm trying to build is a dot net core MVC application that has a form to upload a video file to Google Cloud storage (Google bucket probably?). The controller will take the data from the form and the Model layer is Google Storage.
Some pointers will be really helpful on how can I proceed about this task. Also some links to tutorials or any documentation if you guys think would be useful. Thanks a lot!!
It sounds like you're trying to get end users to upload files into Google Cloud Storage from their web browser. The trick here is that allowing any random anonymous user write access to your GCS bucket is a bad idea, but you also don't want to require that your users have Google Cloud accounts, either.
To resolve this, Google Cloud Storage offers a feature called "signed URLs." Your server uses its credentials to create a URL that is valid for a limited amount of time and, when presented to GCS by the end user, allows it to do a very specific thing as if it is your application's service account (in this case, uploading an object).
The flow goes like this:
Your app signs a URL for uploading an object to GCS and serves it as part of the page to the user.
The user does an upload to GCS using whatever JavaScript libraries you prefer.
If you want the user to use a literal POST web form, the signature is a little different than other cases. Look at the "policy document" section here: https://cloud.google.com/storage/docs/xml-api/post-object#usage_and_examples
Here's a sample that help answer half your question. It demonstrates how to upload a file to Google Cloud Storage:
https://github.com/GoogleCloudPlatform/dotnet-docs-samples/blob/master/storage/api/Storage/Program.cs#L117
I'm developing an application which lets users upload pictures. I'd like to use Google cloud services to store these pictures. I am creating a unique GUID for each image in database and would like to store the images in the cloud with that name. It makes sense for me to make an ajax request for a GUID and then upload the image from the same page directly to google cloud services.
https://github.com/GoogleCloudPlatform/storage-getting-started-javascript/blob/master/index.html
Like shown in this example.
My first question is, should I be sending this to my back-end(C# code) and uploading it from there? Or is this the correct approach?
And my second question if this is the correct approach is, wouldn't exposing my details like that in javascript allow other people to upload from outside my application as well?
An API key, by itself, identifies a call as being associated with a certain project for purposes of billing. It's only necessary for anonymous calls. An API key does not grant any sort of authorizations. If there's an object in a bucket in your project that only your project members can see, the API key won't give anyone permission to read it.
That said, it's not a great idea to share your API key if you can help it, and if you need to share it, you should lock it down as much as possible. API keys can be limited to use with only certain IP addresses, only with certain web referrers (for instance, it will only work with JavaScript clients on www.yoursite.com), or only when run from a particular iPhone or Android app. These precautions aren't cryptographically fool-proof (there's no reason a hacker couldn't spoof a referer header), but they do make them pretty much useless for someone else who just wants to paste an API key somewhere to enable a web app and doesn't want to pay for it themselves.
The problem with using the javascript client's approach for your application is that individual users would either end up uploading objects completely anonymously or with their own Google accounts. Neither is super great, since the anonymous option would basically require you to create a bucket with anonymous writes enabled, and you don't want to do that.
There is a great approach to letting users upload pictures, though: signed URLs. Signed URLs allow your server to securely sign, in advance, a request to upload an object with your credentials. This is your best option for letting anonymous end users securely upload objects to your buckets.
Documentation on signed URLs: https://cloud.google.com/storage/docs/accesscontrol#Signed-URLs
I want to insert a link in the image upload page in the D2L LMS which allows the user to upload an image from our Gravatar service. I understand I can do it through the valence content API but just as we can put in links in the insert stuff sidebar, can we also wrap an LTI link into a link on the image upload page?
Thanks!
The Remote Plugin Service builds on LTI to let you integrate with D2L's LMS in more "native user interaction" kinds of ways. The "Insert Stuff" framework is one of these, as you've recognized. While D2L does intend to offer more Remote Plugin configuration types in the future, currently there is no configuration type for integration with the image upload interaction point. This is, however, a good idea; I'd encourage you to suggest it on the Product Ideas Exchange in the D2L Community site, or make a request for this enhancement through your account or partner manager at D2L.
There is sample code for creating a remote plugin that allows you to insert images using the Insert Stuff Framework, which was introduced in the following blog post: http://devs.valence.desire2learn.com/2013/11/11/making-development-easier-with-the-remote-plugins-test-service/. This sample uses LTI and the Valence Learning Framework APIs to insert images.
Our institution is looking at linking a cloud storage service with D2L and we were investigating the possibility of modifying the path of individual user's lockers to the cloud storage path using Valence.
The APIs appear to allow the creation/deletion/editing of files and folders within a users locker, however is there the ability to edit the location of the locker itself?
No, sorry, the root location of a user's locker is not modifiable through the Valence Learning Framework APIs.
My question is not about FourSquare API and its functions, but about more simpler details that are not well explained on Foursquare API explanations. Thank you very much in advance if someone wants to help me with this doubts:
Foursquare API is a framework you can use to build applications for mobile devices, above of IOS and Android, so i can imagine that they have API for IOS (Objective-C) and Android (Java), right?
From API Doc: "Be sure to note that although API requests are against api.foursquare.com, OAuth token and authorization requests are against foursquare.com.". Does it mean that if i want to use FourSquare app, the users has to have an account on FourSquare?
From API Doc: "For example, if you write an iPhone application, every user who logs in with their foursquare account will be able to make up to 500 users/* requests and up to 500 venues/* requests, etc." I dont understand this sentence. Does it mean that for example, if you use an API method request like "checkins.add()", this method create two methods? one against api.foursquare.com to monitor the API limit requests, and another to your Web Application Server?
So as a question related to the third one, where do you have to store your database? is it stored on Foursquare cloud database because you are loggin there, or you have to create your own Web Service application with its own SQL database?
From API Doc: "All requests are simple GET or POST requests that return JSON or JSONP respones", so i can imagine that the Web Application Service should understand JSON. Well, my main question is, can i use Ruby on Rails to build the Web Application Service and Web Page frontend? I am seeing that there are some wrapps for RoR designed from third companies, but are not official and doesnt cover all the 2.0 API, just the ones they needed for their services.
If i want to create an app using FourSquare API, what do you advice me to use as a programming language/framework for the Web Service Application? the WSA that has to process the JSON requests and later store them on the database, interaction with users on the WebPage, etc.
i am so sorry if my questions are so simple, but i dont have any other place of this level of expertise.
thank you very very much in advance.
The API is REST/JSON based, which means that any language that can do an HTTP request and parse a string can be used. There are Java and iOS libraries available. But you could use just about anything - curl with bash would be a bit extreme but if that floats your boat...
For some of the APIs (search a venue, for example) you do not necessarily need a FourSquar OAuth user token. For others (like checkin) a FourSquare token is required. For any API calls that require a userid, your users will have to be FourSquare users and "trust" your application with their FourSquare data.
Only requests to FourSquare is counted. So if you do a single call to checkins.add() it counts as one call for the user that is doing the checkin. I wouldn't worry about the limits. As long as you're usage of the API is sensible they will not be a problem. And if they do become a problem and you're doing something extraordinarily cool, the folks at FourSquare might be sympathetic.
You have to create your own web server with your own database to store some information. The OAuth token is one. You probably want to cache venue information here for short periods as well.
Yes, your webapp will need to be able to understand JSON. Ruby has excellent JSON support - look for the json gem.
It is really difficult to suggest a language or framework without knowing what it is that you're trying to do. I wouldn't choose a framework based on the fact that you want to use FourSquare (anything will do) but rather on your experience and the unique features of your application. You mentioned RoR before - that would definitely work.