cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CORS Access-Control-Allow-Origin

CORS Access-Control-Allow-Origin

jmccolgan93
Explorer | Level 3

Hey guys, so i have this angular script to pull in a json file I'm storing in Dropbox. my current issue is that I get an Access-Control-Allow-Origin error every time. I'm not really sure how to fix it... 

    <script type="text/javascript">
        var app = angular.module("mig-usedgear", [])
        app.controller("myCtrl", function($scope, $http) {
            $http.get("http://www.dropbox.com/s/8g7fump2tnbohv2/items.json?raw=1")
                .then(function(response) {
                    $scope.friends = response.data;
                });
        });
    </script>
1 Reply 1

Re: CORS Access-Control-Allow-Origin

Greg-DB
Dropboxer

The 'www.dropbox.com site' doesn't allow CORS like this. 

You can technically make this work using 'dl.dropboxusercontent.com' (e.g., "http://dl.dropboxusercontent.com/s/8g7fump2tnbohv2/items.json"), but please note that isn't officially supported.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?