cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Musicians, convert your MuseScore files to PDF to play music on the go! Learn more 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

Greg-DB
Dropbox Staff

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?