1

I am trying to set up a dropbox API on my php website.

It requires that I specify "INSERT_PATH_TO_JSON_CONFIG_PATH"

I have absolutely no idea how to find it.

Any tips would be appreciated.

Uno Mein Ame
  • 1,060
  • 5
  • 16
  • 29

1 Answers1

1

If you're talking about this page, then you don't need to actually specify that anywhere. You can (in theory) do:

require_once "dropbox-sdk/Dropbox/autoload.php";
use \Dropbox as dbx;

$json = '/path/to/file.json';

$appInfo = dbx\AppInfo::loadFromJsonFile($json);
$webAuth = new dbx\WebAuthNoRedirect($appInfo, "PHP-Example/1.0");

Where /path/to/file.json contains:

{
    "key": "INSERT_APP_KEY_HERE",
    "secret": "INSERT_SECRET_HERE"
}

The documentation was simply giving an example, not telling you to make a define.

  • I've never dealt with json, so asking really silly questions, i know. How would I make json "contain" that data? And also, where do I find the APP_KEY and SECRET? Trying to build a simple script that would copy a file from my web server to a folder in my own dropbox – Uno Mein Ame Oct 02 '13 at 03:09
  • They're probably specified in your Dropbox account somewhere. I do not use Dropbox, so I can't point you in the right direction. However, if you try Googling "Dropbox find API key" and "Dropbox find secret" you should be able to get instructions on where to fill in those values. Also, to make a `.json` file, simply make a `.txt` file, put the contents specified above with your API key and secret, then change the `.txt` to `.json` and upload. @UnoMeinAme –  Oct 02 '13 at 03:12
  • @UnoMeinAme Also, just so you know, JSON is basically a way to convert an array or object into a single string and store it in, say, an MYSQL database. You can find [more information here](http://stackoverflow.com/questions/383692/what-is-json-and-why-would-i-use-it). –  Oct 02 '13 at 03:16