Documentation

Download one of the API libraries

You can grab any of our API libraries to make it really easy to hit the ground running.

Using the PHP library you can make a command line call to the test API.
chmod u+x openphoto
./openphoto -vp -h example.com -e /hello.json
You should see something like this.
==========
Method: get
Host: example.com
Endpoint: /hello.json
==========

{
  "message" : "Hello, world!",
  "code" : 200,
  "result" : {
    "__route__" : "\/hello.json",
    "oauth_consumer_key" : ""
  }
}

Get your OAuth tokens

The easiest way to create an app and get the OAuth tokens is to browse to your Trovebox site and go to /v1/oauth/flow. Follow the prompts until you get a success message. Then go to /manage/apps and you should see the following parameters:

  • Consumer Key
  • Consumer Secret
  • OAuth Token
  • OAuth Secret

Use your OAuth tokens to make authenticated calls

First, call the same endpoint as before with an additional parameter auth=true.

./openphoto -vp example.com -e /hello.json -F 'auth=true'
You should get an unauthorized 403 code.
==========
Method: get
Host: current.trovebox.com
Endpoint: /hello.json
==========

{
  "message" : "You do not have sufficient permissions to access this page.",
  "code" : 403,
  "result" : null
}
Now export your OAuth credentials and run the command again.
export consumerKey=your_consumer_key
export consumerSecret=your_consumer_secret
export token=your_oauth_token
export tokenSecret=your_oauth_token_secret

./openphoto -vp example.com -e /hello.json -F 'auth=true'
You should see a successful response.
==========
Method: get
Host: current.trovebox.com
Endpoint: /hello.json
==========

{
  "message" : "Hello, world!",
  "code" : 200,
  "result" : {
    "__route__" : "\/hello.json",
    "auth" : "true",
    "oauth_consumer_key" : "7f66a2854e521114d3914753a6964c"
  }
}

Go build something!

Everything we've built has been on top of this API. It's the core of the software and we can't wait to see what you come up with.