API DOCUMENTATION
CREATING A CLIP
To create a clip programmatically, send a POST-request to URL https://uclipboard.com/address/, where address is the clip's address
POST-request must contain a parameter content, where the clip's content is provided
To get a valid JSON response, you must add a parameter "type" with value "api" to API requests
As a result, a JSON response will be returned:
Parameter Name | Parameter Value |
success | true if clip created successfully, otherwise false |
Implementation in Python 3.x (this code uses the requests library):
import requests
address = 'myclip'
content = 'Hello world!'
response = requests.post('https://uclipboard.com/' + address, data = {'content': content, 'type': 'api'}).json()
if response['success']:
print('The clip has been created successfully!')
else:
print('There was a problem while creating the clip')
RETRIEVING CLIP CONTENT
To retrieve a clip content programmatically, send a GET-request or POST-request to URL https://uclipboard.com/address/json, where address is the clip's address
As a result, a JSON response will be returned:
Parameter Name | Parameter Value | Notice |
success | true if clip content retrieved successfully, otherwise false | |
message | error message | only appears when success is false |
content | the clip's content | only appears when success is true |
Implementation in Python 3.x (this code uses the requests library):
import requests
address = 'myclip'
response = requests.post('https://uclipboard.com/' + address + '/json').json()
if response['success']:
print('Address: uclipboard.com/' + address)
print('Content: ' + response['content'])
else:
print('There was a problem while retrieving clip content')
print('Error message: ' + response['message'])