Skip to content

Instantly share code, notes, and snippets.

@thejeshgn
Last active November 29, 2018 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thejeshgn/f817ff92f87736fe3dfb8f3df496f8f8 to your computer and use it in GitHub Desktop.
Save thejeshgn/f817ff92f87736fe3dfb8f3df496f8f8 to your computer and use it in GitHub Desktop.
swagger: '2.0'
info:
title: Likes API
description: Simple Likes API written by [Dave Winer](https://github.com/scripting/likes) for registering likes. I created this documentation for the API for my own use. You can use it too. [Thejesh GN](https://thejeshgn.com)
version: "0.4.10"
# the domain of the dave's service. You can change it to yours
host: likes.scripting.com
# array of all schemes that your API supports.
schemes:
- http
produces:
- application/json
paths:
/toggle:
get:
summary: Toggle - like or unlike
description: |
This will toggle the logged in use's like for a specific url.
parameters:
- name: oauth_token
in: query
description: oauth_token
required: true
type: string
- name: oauth_token_secret
in: query
description: oauth_token_secret
required: true
type: string
- name: url
in: query
description: URL which you want to like or unlike
required: true
type: string
responses:
200:
description: An array of usernames who have liked
schema:
type: array
items:
type: string
/likes:
get:
summary: Get likes for a given URL
description: |
Given a url it will get the urls. It doesn't need credentials.
parameters:
- name: url
in: query
description: URL which you want to get the details likes
required: true
type: string
responses:
200:
description: An array of usernames who have liked, ordered by when they liked.
schema:
type: array
items:
type: string
/mylikes:
get:
summary: Get the list of likes by the present user
description: |
This will get you the list of liked urls by the presently logged in user
parameters:
- name: oauth_token
in: query
description: oauth_token
required: true
type: string
- name: oauth_token_secret
in: query
description: oauth_token_secret
required: true
type: string
responses:
200:
description: An array of urls the urer has liked
schema:
type: array
items:
type: string
/toplikes:
get:
summary: Get the list of top likes
description: |
This will get you top ten likes on the platfom
responses:
200:
description: An array of urls the urer has liked
schema:
type: array
items:
type: object
properties:
url:
type: string
description: Liked url
ctLikes:
type: number
description: Number of people liked this url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment