Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "swagger": "2.0"
- "info": {
- "description": "This is a Level-3 API implementation of Instagram. This API provides extra functionality to the already existing level-2 Instagram API.\n",
- "version": "1.0.0",
- "title": "Instagram Level-3 API",
- "termsOfService": "http://damp-sierra-3292.herokuapp.com/terms/",
- "contact": {
- "name": "admin@damp-sierra-3292.herokuapp.com"
- },
- "license": {
- "name": "Apache 2.0",
- "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
- }
- },
- "host": "damp-sierra-3292.herokuapp.com",
- "basePath": "/",
- "schemes": [
- "http"
- ],
- "paths": {
- "/users/search": {
- "get": {
- "tags": [
- "user"
- ],
- "summary": "Search for users on Instagram",
- "description": "This endpoint will return a list of users that match the given query.",
- "operationId": "getUserById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "query",
- "name": "q",
- "description": "The query that needs to be executed.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/User"
- }
- },
- "500": {
- "description": "An unknown error occurred while processing"
- },
- "204": {
- "description": "There were no users found that match the given query"
- }
- }
- }
- },
- "/users/{userId}": {
- "get": {
- "tags": [
- "user"
- ],
- "summary": "Request user information",
- "description": "This endpoint will return basic user information given an access token and user id.",
- "operationId": "getUserById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "userId",
- "description": "The user id that needs to be fetched.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/User"
- }
- },
- "400": {
- "description": "User not found"
- }
- }
- }
- },
- "/users/{userId}/media/recent": {
- "get": {
- "tags": [
- "user"
- ],
- "summary": "Request the media that was recently posted by the user",
- "description": "This endpoint will return a list of the media that is uploaded by this user.",
- "operationId": "getMediaByUser",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "userId",
- "description": "The user id whose media needs to be fetched.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Media"
- }
- },
- "204": {
- "description": "The user has no media."
- },
- "400": {
- "description": "User not found"
- }
- }
- }
- },
- "/users/{userId}/follow": {
- "post": {
- "tags": [
- "user"
- ],
- "summary": "Follow a given user",
- "description": "Follow a given user on Instagram provided his user id",
- "operationId": "followUser",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "userId",
- "description": "The currently logged in user.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "The user was successfully followed (or a request was sent to a private user to acquire permission."
- },
- "400": {
- "description": "Bad Request"
- },
- "404": {
- "description": "User to be followed not found"
- },
- "500": {
- "description": "Internal server error"
- }
- }
- }
- },
- "/users/{userId}/unfollow": {
- "delete": {
- "tags": [
- "user"
- ],
- "summary": "Unfollow a given user",
- "description": "Unfollow a given user on Instagram provided his user id",
- "operationId": "unfollowUser",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "userId",
- "description": "The currently logged in user.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "The user was successfully unfollowed (or a request was sent to a private user to acquire permission."
- },
- "400": {
- "description": "Bad Request"
- },
- "404": {
- "description": "User to be unfollowed not found"
- },
- "500": {
- "description": "Internal server error"
- }
- }
- }
- },
- "/users/{userId}/followed-by": {
- "get": {
- "tags": [
- "user"
- ],
- "summary": "List of followers",
- "description": "return a list of the users that are following the authenticated user.",
- "operationId": "listOfFollowees",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "userId",
- "description": "The user id for which you want to retrieve the followers.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "The list of followers was successfully retrieved.",
- "schema": {
- "$ref": "#/definitions/User"
- }
- },
- "204": {
- "description": "User has no followers"
- },
- "400": {
- "description": "User not found"
- }
- }
- }
- },
- "/users/{userId}/follows": {
- "get": {
- "tags": [
- "user"
- ],
- "summary": "List of followers",
- "description": "return a list of the users that the authenticated user is following.",
- "operationId": "listOfFollowers",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "userId",
- "description": "The user id for which you want to retrieve the followers.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "The list of followers was successfully retrieved.",
- "schema": {
- "$ref": "#/definitions/User"
- }
- },
- "204": {
- "description": "User is not following anyone"
- },
- "400": {
- "description": "User not found"
- }
- }
- }
- },
- "/users/self/feed": {
- "get": {
- "tags": [
- "user"
- ],
- "summary": "Get users feed",
- "description": "return a list of media which the followees of the user have posted.",
- "operationId": "feed",
- "produces": [
- "application/json"
- ],
- "responses": {
- "200": {
- "description": "The list of media was successfully retrieved.",
- "schema": {
- "$ref": "#/definitions/Media"
- }
- },
- "204": {
- "description": "User is not following anyone"
- },
- "400": {
- "description": "There is no user authenticated"
- }
- }
- }
- },
- "/users/self/media/liked": {
- "get": {
- "tags": [
- "user"
- ],
- "summary": "Get users liked media",
- "description": "return a list of media which the user has liked.",
- "operationId": "mediaLiked",
- "produces": [
- "application/json"
- ],
- "responses": {
- "200": {
- "description": "The list of media was successfully retrieved.",
- "schema": {
- "$ref": "#/definitions/Media"
- }
- },
- "204": {
- "description": "User has not liked anything"
- },
- "400": {
- "description": "There is no user authenticated"
- }
- }
- }
- },
- "/media/{mediaId}": {
- "get": {
- "tags": [
- "media"
- ],
- "summary": "Request media",
- "description": "This endpoint will return basic media information given an access token and media id.",
- "operationId": "getMediaById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "mediaId",
- "description": "The media id that needs to be fetched.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Media"
- }
- },
- "404": {
- "description": "media not found"
- }
- }
- }
- },
- "/media/{mediaId}/likes": {
- "get": {
- "tags": [
- "media"
- ],
- "summary": "Get likes for media",
- "description": "This endpoint will get all the like to the media specified by the media id.",
- "operationId": "GetLikeMediaById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "mediaId",
- "description": "The media id that will receive the like",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Media"
- }
- },
- "204": {
- "description": "The media has no liked"
- },
- "400": {
- "description": "Media not found"
- }
- }
- },
- "delete": {
- "tags": [
- "media"
- ],
- "summary": "Delete like for media",
- "description": "This endpoint will delete a like of the media specified by the media id.",
- "operationId": "DeleteMediaById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "mediaId",
- "description": "The media id for which the like will be deleted.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Media"
- }
- },
- "204": {
- "description": "The user has never liked this media in the first place"
- },
- "400": {
- "description": "Media not found"
- }
- }
- },
- "put": {
- "tags": [
- "media"
- ],
- "summary": "Like media",
- "description": "This endpoint will post a like to the media specified by the media id.",
- "operationId": "LikeMediaById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "mediaId",
- "description": "The media id that will receive the like.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Media"
- }
- },
- "204": {
- "description": "The user has already liked this media."
- },
- "400": {
- "description": "Media not found"
- }
- }
- }
- },
- "/media/{mediaId}/comments": {
- "get": {
- "tags": [
- "media"
- ],
- "summary": "Get media comments",
- "description": "This endpoint will get all the comments for the media specified by the media id.",
- "operationId": "getMediaById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "mediaId",
- "description": "The media id that is used to identify the media.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Media"
- }
- },
- "204": {
- "description": "Media has no comments"
- },
- "400": {
- "description": "Media not found"
- }
- }
- }
- },
- "/media/{mediaId}/{commentId}": {
- "delete": {
- "tags": [
- "media"
- ],
- "summary": "Delete media comment",
- "description": "This endpoint will delete a comment on the media specified by the media id.",
- "operationId": "getMediaById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "mediaId",
- "description": "The media id that will identify the media.",
- "required": true,
- "type": "string"
- },
- {
- "in": "path",
- "name": "commentId",
- "description": "The comment id that will be deleted.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Media"
- }
- },
- "204": {
- "description": "Comment not found"
- },
- "404": {
- "description": "Media not found"
- }
- }
- }
- },
- "/media/search/": {
- "get": {
- "tags": [
- "media"
- ],
- "summary": "Look for media ",
- "description": "This endpoint will look for media that match a given query",
- "operationId": "searchMediaByQuery",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "query",
- "name": "lat",
- "description": "The latitude of the media to be queried.",
- "required": true,
- "type": "string"
- },
- {
- "in": "query",
- "name": "lng",
- "description": "The longitude of the media to be queried.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Media"
- }
- },
- "204": {
- "description": "No media found"
- },
- "400": {
- "description": "Something went wrong when processing the request"
- }
- }
- }
- },
- "/media/popular/": {
- "get": {
- "tags": [
- "media"
- ],
- "summary": "Get for trending media ",
- "description": "This endpoint will look for the most popular media on instagram",
- "operationId": "getPopularMedia",
- "produces": [
- "application/json"
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Media"
- }
- },
- "204": {
- "description": "No media found"
- },
- "400": {
- "description": "Something went wrong when processing the request"
- }
- }
- }
- },
- "/locations/{locationId}": {
- "get": {
- "tags": [
- "location"
- ],
- "summary": "Request location information",
- "description": "This endpoint will return basic location information and links to its media given an access token and location id.",
- "operationId": "getLocationById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "locationId",
- "description": "The location id that needs to be fetched.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Location"
- }
- },
- "404": {
- "description": "Location not found"
- }
- }
- }
- },
- "/locations/search": {
- "get": {
- "tags": [
- "location"
- ],
- "summary": "Search for locations ",
- "description": "This endpoint will returns a list of locations that match for the given query.",
- "operationId": "getLocationById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "query",
- "name": "lat",
- "description": "The latitude of the location to be queried.",
- "required": true,
- "type": "string"
- },
- {
- "in": "query",
- "name": "lng",
- "description": "The longitude of the location to be queried.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Location"
- }
- },
- "204": {
- "description": "There were no locations that matched this query"
- },
- "400": {
- "description": "Something went wrong when processing the request"
- }
- }
- }
- },
- "/locations/{locationId}/media/recent": {
- "get": {
- "tags": [
- "location"
- ],
- "summary": "Get a list of recent media",
- "description": "This endpoint will returns a list of recent media that were taken on this locations.",
- "operationId": "getRecentMediaLocationById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "locationId",
- "description": "The location that should be queried.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation",
- "schema": {
- "$ref": "#/definitions/Location"
- }
- },
- "204": {
- "description": "There were media for this locations"
- },
- "404": {
- "description": "Location was not found"
- }
- }
- }
- }
- },
- "securityDefinitions": {
- "instagram_auth_key": {
- "type": "oauth2",
- "authorizationUrl": "https://api.instagram.com/oauth/authorize?client_id=3ceafec5c7ee4e28bff830f06fb27137&redirect_uri=https%3A%2F%2Fdamp-sierra-3292.herokuapp.com%2Fredirect&scope=basic+comments+relationships+likes&response_type=code",
- "flow": "implicit",
- "scopes": {
- "basic": "read any and all data related to a user",
- "comments": "Add or remove comments on a user's behalf",
- "relationships": "to follow and unfollow users on a user's behalf",
- "likes":" like and unlike items on a user's behalf"
- }
- }
- },
- "definitions": {
- "User": {
- "properties": {
- "id": {
- "type": "string"
- },
- "username": {
- "type": "string"
- },
- "fullName": {
- "type": "string"
- },
- "profilPicture": {
- "type": "string",
- "description": "Link to the users profile picture."
- },
- "bio": {
- "type": "string"
- },
- "website": {
- "type": "string",
- "description": "Link to users website."
- },
- "uploadCount": {
- "type": "integer",
- "format": "int32",
- "description": "Amount of media the user has uploaded."
- },
- "followers": {
- "type": "integer",
- "format": "int32",
- "description": "Amount of the followers the user has."
- },
- "followees": {
- "type": "integer",
- "format": "int32",
- "description": "Amount of users that is following the user."
- }
- }
- },
- "Comment": {
- "properties": {
- "id": {
- "type": "string"
- },
- "from": {
- "$ref": "#/definitions/User"
- },
- "date": {
- "type": "string",
- "format": "date-time"
- }
- }
- },
- "Image": {
- "properties": {
- "url": {
- "type": "string"
- },
- "width": {
- "type": "integer",
- "format": "int64"
- },
- "height": {
- "type": "integer",
- "format": "int64"
- }
- }
- },
- "Media": {
- "properties": {
- "type": {
- "type": "string",
- "description": "Descartes the media type (image or video)"
- },
- "usersInMedia": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/User"
- }
- },
- "filter": {
- "type": "string",
- "description": "Filter used for this media"
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "comments": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Comment"
- }
- },
- "caption": {
- "type": "string"
- },
- "likes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/User"
- }
- },
- "date": {
- "type": "integer",
- "format": "int64"
- },
- "link": {
- "type": "string"
- },
- "user": {
- "$ref": "#/definitions/User"
- },
- "id": {
- "type": "integer",
- "format": "int32"
- },
- "image": {
- "$ref": "#/definitions/Image"
- },
- "location": {
- "$ref": "#/definitions/Location"
- }
- }
- },
- "Location": {
- "properties": {
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "latitude": {
- "type": "integer",
- "format": "int64"
- },
- "longitude": {
- "type": "integer",
- "format": "int64"
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement