Ge.tt API

Overview

The Ge.tt API allows you to use Ge.tt in your own applications. We believe that our users should be able to access their files and share their content in their platform of choice. By using the API, developers are able to easily put their own content, or the content of their users online. At the same time they are able to use Ge.tt's unique real-time file sharing technology where files are available before they are even uploaded.

Getting started

To get started, first create an app, and then go read the Getting Started page. It's a few simple calls and you should be ready to go.

Then go read the REST API and get cooking. If you need the advanced queing nature of Ge.tt, then read the Live API (note that this is not needed to do simple file uploads).

Usage? Questions?

For any questions or comments please contact us. We would also love to know if you are using the API and what you are using it for. It would be great if we could feature your plugins here on the page so others can make use of it.

REST API

With some simple functions you are able to use the essential parts of Ge.tt and make your own apps and plugins for programs, on top of Ge.tt.

This page is only an overview of the functions. Click on a method to see explanation and examples.

If you have any questions, comments, or would like to show us what you have done, then send please contact us.


Users

Logs in a user
Returns state of the user currently logged in

Shares

Returns a list of all shares
Returns state and files in one share
Create a new share
Update state in a share
Deletes a share and its containing files

Files

Create a new file in a share
Returns state of a file with a given fileid
Deletes a single file in a share
Returns a (new) list of URLs to upload a file to
Returns the file (the actual data)
Returns a thumb of a file (available for images)
Returns a scaled version of the file (available for images)

Live API

The live API is what makes Ge.tt really powerful. With this on hand you are able to utilize the advanced queing of Ge.tt that makes you able to upload several files at the same time, and let them be available to others immediately. You should only use this if you really need it.

The REST api handles creation/upload of shares and files. All the live API only handles messages to the program via a WebSocket. But programs implementing the API should uphold to the queing nature of Ge.tt.
If you have any questions, comments, or would like to show us what you have done, then send please contact us.


Messages sent

Should receive a pong message right after
Lets the server know that you are ready to receive live messages

Messages received

Sent when one of your files are downloaded
Sent if one of the files uploading is too large for your current storage limit
Sent when a file starts uploading and the file size is known (browser usage)
Sent if an uploaded file violated the Ge.tt terms and is removed

Create app

In order to get started with the Ge.tt API, first you need to register a new application. You receive an API key which you use to connect with the Ge.tt API afterwards.

Note: your API key is secret and personal. Use it as such.

C# module

Kim Andersen created a Ge.tt module for C#. He even created an implementation of the Live API which makes this module extremely powerful but still easy to use.

http://www.codeproject.com/KB/webservices/GettNET.aspx

Note: this module was not created by Ge.tt and we can't offer any support or guarantee its stability

Python module

Mark Allen created a Ge.tt module for Python which makes it easy for Python developers to interact with the Ge.tt API.

http://pypi.python.org/pypi/pygett/1.0.1

Note: this module was not created by Ge.tt and we can't offer any support or guarantee its stability

Perl module

Mark Allen, created a module which makes it easy for Perl programmers to interact with the Ge.tt API.

https://github.com/mrallen1/Net-API-Gett

Note: this module was not created by Ge.tt and we can't offer any support or guarantee its stability

Apps

You haven't created any apps. Go to the Create App tab and get started on your first app!

Getting started

This page goes to show how to connect, create your first share, and upload a file. The examples are with curl, but you should be able to understand the data sent and use it with another program.
1. Authenticate
First, you need to authenticate. The first time, use email/password. Any other time you need to log in, use the refreshtoken.
curl -X POST --data '{"apikey":"...","email":"your@em.ail","password":"..."}' https://open.ge.tt/1/users/login
Server will return some JSON of your users' state. You can see how much storage space you have and how much you've used. Most importantly it returns an accesstoken and a refreshtoken. Use the refreshtoken next time this user needs to log in (don't store the users' password in your app). The accesstoken is used to all other calls to the server.
{
  "accesstoken":"a.0101.123123123123",
  "refreshtoken":"r.0101.acbcabacbacbacb",
  ...
}
2. Create your first share.
curl -X POST https://open.ge.tt/1/shares/create?accesstoken=a.0101.123123123123
The share will be returned. Most importantly you use the sharename.
{
  "sharename":"a1b2c3"
  ...
}
3. Create file
Now it's time to upload your first file. The way this works is that you first create your file, and then upload it afterwards.
To test it out use a small file. You can use echo "hello world" > myfile.txt to create a test file.
curl -X POST --data '{"filename":"myfile.txt"}' https://open.ge.tt/1/files/a1b2c3/create?accesstoken=a.0101.123123123123
The server returns various things. The readystate is remote which means that the server now knows that the file exists, but you need to upload it. Then a URL for where the file can be seen by others - this is the link you should post to others. Most importantly it contains two URL's where should upload the file to. There are two URL's because you can either use PUT or POST.
{
  "readystate":"remote",
  "getturl":"http://ge.tt/a1b2c3/v/0",
  "upload":{
    "puturl":"http://blobs.ge.tt/a1b2c3/myfile.txt?sig=-TR2k2-3kjsh9nfmn4",
    "posturl":"http://blobs.ge.tt/a1b2c3/?filename=myfile.txt&sig=-TR2k2-3kjsdfkjhf3ksf"
  }
  ...
}
4. Upload file
Finally, upload the file. In this example we use the puturl.
curl --upload-file myfile.txt http://blobs.ge.tt/a1b2c3/myfile.txt?sig=-TR2k2-3kjsh9nfmn4
Now, to see that it works, open http://ge.tt/a1b2v3/v/0 in your browser.
Congratulations! You just uploaded your first file to Ge.tt.

To continue, read the REST API and see what else you can do. For the advanced users, you can read up on the Live API which is used to utilize the advanced queing functions of Ge.tt.