Retrieve, add, modify and delete links from Linkbucket with easy to use JSON API.
Important:
Please don't forget about headers when making requests, because back-end will only return JSON encoded errors and messages when
Accept
header is set to
application/json
.
Accept
header is set to
application/json
.
Register a user and get an api token.
POST
http://linkbucket.robotronica.mx/api/register
Name | Type | Optional | Description |
---|---|---|---|
name | string | False | Name of the user to register. |
string | False | Email of the user to register. | |
password | string | False | Password of the user to register. |
password_confirmation | string | False | Password confirmation of the user to register. |
Example register request
POST /api/register HTTP/1.1 |
Content-Type: application/x-www-form-urlencoded |
Accept: application/json |
name=Juan&
email=juan@doe.mx&
password=password123&
password_confirmation=password123
|
Example register response
HTTP/1.1 200 OK |
Content-Type: application/json |
Status: 200 OK |
{
"data":{
"name":"Juan"
"email":"juan@doe.mx"
"updated_at":"2018-07-31 01:56:44"
"created_at":"2018-07-31 01:56:44"
"id":1
"api_token":"MJCx3tNbpDBjXMpEI3rU6puWLqjygE1n9pNah79qej3h1TEMvGLmkRpjnwpK"
}
}
|
Login existing user and get an api token.
POST
http://linkbucket.robotronica.mx/api/login
Name | Type | Optional | Description |
---|---|---|---|
string | False | Email of existing user | |
password | string | False | Password of existing user |
Example login request
POST /api/login HTTP/1.1 |
Content-Type: application/x-www-form-urlencoded |
Accept: application/json |
email=juan@doe.mx&
password=password123&
|
Example login response
HTTP/1.1 200 OK |
Content-Type: application/json |
Status: 200 OK |
{
"data":{
"name":"Juan"
"email":"juan@doe.mx"
"updated_at":"2018-07-31 01:56:44"
"created_at":"2018-07-31 01:56:44"
"id":1
"api_token":"MJCx3tNbpDBjXMpEI3rU6puWLqjygE1n9pNah79qej3h1TEMvGLmkRpjnwpK"
}
}
|
Get a list with all links from authenticated user.
GET
http://linkbucket.robotronica.mx/api/retrieve
Name | Type | Optional | Description |
---|---|---|---|
api_token | string | False | API token obtained in login. |
Example retrieve request
POST /api/retrieve HTTP/1.1 |
Content-Type: application/x-www-form-urlencoded |
Accept: application/json |
api_key=MJCx3tNbpDBjXMpEI3rU6puWLqjygE1n9pNah79qej3h1TEMvGLmkRpjnwpK
|
Example retrieve response
HTTP/1.1 200 OK |
Content-Type: application/json |
[
{
"id": 336,
"user_id": 3,
"title": "DuckDuckGo",
"link": "https://duckduckgo.com/lite",
"created_at": "2018-07-31 03:43:36",
"updated_at": "2018-07-31 03:43:36",
"Tags": [
"Search",
"Privacy",
"Lite"
]
}
]
|
Get single link from authenticated user
GET
http://linkbucket.robotronica.mx/api/retrieve/{id}
Name | Type | Optional | Description |
---|---|---|---|
api_token | string | False | API token obtained in login. |
Example single retrieve request
POST /api/retrieve/{id} HTTP/1.1 |
Content-Type: application/x-www-form-urlencoded |
Accept: application/json |
api_token=MJCx3tNbpDBjXMpEI3rU6puWLqjygE1n9pNah79qej3h1TEMvGLmkRpjnwpK
|
Example single retrieve response
HTTP/1.1 200 OK |
Content-Type: application/json |
{
"id": 336,
"user_id": 3,
"title": "DuckDuckGo",
"link": "https://duckduckgo.com/lite",
"created_at": "2018-07-31 03:43:36",
"updated_at": "2018-07-31 03:43:36",
"Tags": [
"Search",
"Privacy",
"Lite"
]
}
|
Add a link with tags
POST
http://linkbucket.robotronica.mx/api/add
Name | Type | Optional | Description |
---|---|---|---|
api_token | string | False | API token obtained in login |
title | string | True | Title of the link (retrieved from website if not set) |
link | string | False | URL of the link. |
tags | string | True | Space separated tags related with the link. |
Example of add request
POST /api/add HTTP/1.1 |
Content-Type: application/x-www-form-urlencoded |
Accept: application/json |
api_token=MJCx3tNbpDBjXMpEI3rU6puWLqjygE1n9pNah79qej3h1TEMvGLmkRpjnwpK&
link=https://peertube.social/&
tags=streaming%20free%20open-source%20peer2peer
|
Example of add response
HTTP/1.1 200 OK |
Content-Type: application/json |
Status: 200 OK |
{
"id": 339,
"user_id": 3,
"title": "peertube.social",
"link": "https://peertube.social/",
"created_at": "2018-07-31 22:41:18",
"updated_at": "2018-07-31 22:41:18",
"Tags": [
"Streaming",
"Free",
"Open-Source",
"Peer2Peer"
]
}
|
Edit an existing link from authenticated user.
POST
http://linkbucket.robotronica.mx/api/edit/{id}
Name | Type | Optional | Description |
---|---|---|---|
api_token | string | False | API token obtained in login |
title | string | False | New title for link (can remain the same) |
link | string | False | New URL for link (can remain the same) |
tags | string | False | New space separated tags for link (can remain the same) |
Example of edit request
POST /api/edit/{id} HTTP/1.1 |
Content-Type: application/x-www-form-urlencoded |
Accept: application/json |
api_token=MJCx3tNbpDBjXMpEI3rU6puWLqjygE1n9pNah79qej3h1TEMvGLmkRpjnwpK&
title=NSA%20Peertube&
link=https://peertube.nsa.ovh/&
tags=streaming%20free%20open-source%20peer2peer
|
Example of edit response
HTTP/1.1 200 OK |
Content-Type: application/json |
Status: 200 OK |
{
"id": 339,
"user_id": 3,
"title": "NSA Peertube",
"link": "https://peertube.nsa.ovh/",
"created_at": "2018-07-31 22:41:18",
"updated_at": "2018-07-31 23:02:27",
"Tags": [
"Streaming",
"Free",
"Open-Source",
"Peer2Peer"
]
}
|
Delete an existing link of authenticated user.
POST
http://linkbucket.robotronica.mx/api/delete/{id}
Name | Type | Optional | Description |
---|---|---|---|
api_token | string | False | API token obtained in login |
Example of delete request
POST /api/delete/{id} HTTP/1.1 |
Content-Type: application/x-www-form-urlencoded |
Accept: application/json |
api_token=MJCx3tNbpDBjXMpEI3rU6puWLqjygE1n9pNah79qej3h1TEMvGLmkRpjnwpK
|
Example of delete response
HTTP/1.1 200 OK |
Content-Type: application/json |
Status: 200 OK |
{
"id": 339,
"user_id": 3,
"title": "NSA Peertube",
"link": "https://peertube.nsa.ovh/",
"created_at": "2018-07-31 22:41:18",
"updated_at": "2018-07-31 23:02:27",
"Tags": [
"Streaming",
"Free",
"Open-Source",
"Peer2Peer"
]
}
|
Logout user and make current API token invalid.
POST
http://linkbucket.robotronica.mx/api/logout
Name | Type | Optional | Description |
---|---|---|---|
api_token | string | False | API token obtained in login |
Example of logout request
POST /api/logout HTTP/1.1 |
Content-Type: application/x-www-form-urlencoded |
Accept: application/json |
api_token=MJCx3tNbpDBjXMpEI3rU6puWLqjygE1n9pNah79qej3h1TEMvGLmkRpjnwpK
|
Example of logout response
HTTP/1.1 200 OK |
Content-Type: application/json |
Status: 200 OK |
{
"data": "User logged out."
}
|