Welcome to the Clipboard API! With it you can: get an API key, set and get clipboard contents.
The Request returns JSON structured like this:
{
"access_token": "",
"scope": "read write",
"refresh_token": "",
"token_type": "Bearer",
"expires_in": 36000
}
Clipboard uses API keys to allow access to the API. Use the following API endpoint to create an account and get a API key.
POST http://example.com/sign_up
| Parameter | Description |
|---|---|
| username | The username for a new account |
| password | The password associated with username |
Clipboard expects for the API key to be included in all API requests to the server in a header that looks like the following:
Authorization: Bearer API_KEY_HERE
API_KEY_HERE with your personal API key.
The Clipboard API is used to create clipboards and retrieve contents. It enables a way to quickily share text and files between multiple devices.
This endpoint creates a new clipboard and sets the contents.
The setData command returns JSON structured like this:
{
"id": "LxF4yGsq",
}
POST http://example.com/api/clipboard
| Parameter | Description |
|---|---|
| username | The username |
| password | The password |
| text | The text to be uploaded |
| Parameter | Description |
|---|---|
| username | The username |
| password | The password |
| file | The file to be uploaded |
1 MB in size.
This id is required to retrive the data when executing the getData Request.
This endpoint retrieves a specific clipboard's content.
The response for text returns JSON structured like this:
{
"data": "text"
}
GET http://example.com/api/clipboard/getData/?session_id=[id]
Content-Disposition header setup for automatic download.
Once a clipboard is retrieved, it is deleted.
| Parameter | Description |
|---|---|
| id | The ID of the clipboard data to retrieve |
| Parameter | Description |
|---|---|
| username | The username |
| password | The password |
This endpoint retrieves a specific clipboard media's metadata.
The response for text returns JSON structured like this:
{
"entry": {
"session_id": "LfK6nnSq",
"creation_time": "2018-04-15T22:26:29.227258Z"
},
"media_type": "Text"
}
The response for a file returns JSON structured like this:
{
"entry": {
"session_id": "x2ORXMPE",
"creation_time": "2018-04-15T23:08:51.932987Z"
},
"FileMetaData": {
"file_name": "10677856_7r6NaRe.jpg",
"file_length": 3,
"file_type": "image/jpeg"
},
"media_type": "File"
}
GET http://example.com/api/clipboard/getMetadata/?session_id=[id]
| Parameter | Description |
|---|---|
| ID | The ID of the clipboard to retrieve |
| Parameter | Description |
|---|---|
| username | The username |
| password | The password |