Linkbucket API [experimental]

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 .

Important: Error responses will include a "message" key when Accept header is set to application/json .
Register a user

Register a user and get an api token.

URL:

POST http://linkbucket.robotronica.mx/api/register

Parameters
Name Type Optional Description
name string False Name of the user to register.
email 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.
Examples:

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

Login existing user and get an api token.

URL:

POST http://linkbucket.robotronica.mx/api/login

Parameters
Name Type Optional Description
email string False Email of existing user
password string False Password of existing user
Examples:

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"  } }
Retrieving all links from user

Get a list with all links from authenticated user.

URL:

GET http://linkbucket.robotronica.mx/api/retrieve

Parameters
Name Type Optional Description
api_token string False API token obtained in login.
Examples:

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"   ]  } ]
Retrieve single link from user

Get single link from authenticated user

URL:

GET http://linkbucket.robotronica.mx/api/retrieve/{id}

Parameters
Name Type Optional Description
api_token string False API token obtained in login.
Examples:

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

Add a link with tags

URL:

POST http://linkbucket.robotronica.mx/api/add

Parameters
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.
Examples:

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"  ] }
Modify an existing link

Edit an existing link from authenticated user.

URL:

POST http://linkbucket.robotronica.mx/api/edit/{id}

Parameters
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)
Examples:

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 link

Delete an existing link of authenticated user.

URL:

POST http://linkbucket.robotronica.mx/api/delete/{id}

Parameters
Name Type Optional Description
api_token string False API token obtained in login
Examples:

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 delete token

Logout user and make current API token invalid.

URL:

POST http://linkbucket.robotronica.mx/api/logout

Parameters
Name Type Optional Description
api_token string False API token obtained in login
Examples:

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." }