Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.14 KB | None | 0 0
  1. {
  2. "swagger": "2.0"
  3. "info": {
  4. "description": "This is a Level-3 API implementation of Instagram. This API provides extra functionality to the already existing level-2 Instagram API.\n",
  5. "version": "1.0.0",
  6. "title": "Instagram Level-3 API",
  7. "termsOfService": "http://damp-sierra-3292.herokuapp.com/terms/",
  8. "contact": {
  9. "name": "admin@damp-sierra-3292.herokuapp.com"
  10. },
  11. "license": {
  12. "name": "Apache 2.0",
  13. "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
  14. }
  15. },
  16. "host": "damp-sierra-3292.herokuapp.com",
  17. "basePath": "/",
  18. "schemes": [
  19. "http"
  20. ],
  21. "paths": {
  22. "/users/search": {
  23. "get": {
  24. "tags": [
  25. "user"
  26. ],
  27. "summary": "Search for users on Instagram",
  28. "description": "This endpoint will return a list of users that match the given query.",
  29. "operationId": "getUserById",
  30. "produces": [
  31. "application/json"
  32. ],
  33. "parameters": [
  34. {
  35. "in": "query",
  36. "name": "q",
  37. "description": "The query that needs to be executed.",
  38. "required": true,
  39. "type": "string"
  40. }
  41. ],
  42. "responses": {
  43. "200": {
  44. "description": "successful operation",
  45. "schema": {
  46. "$ref": "#/definitions/User"
  47. }
  48. },
  49. "500": {
  50. "description": "An unknown error occurred while processing"
  51. },
  52. "204": {
  53. "description": "There were no users found that match the given query"
  54. }
  55. }
  56. }
  57. },
  58. "/users/{userId}": {
  59. "get": {
  60. "tags": [
  61. "user"
  62. ],
  63. "summary": "Request user information",
  64. "description": "This endpoint will return basic user information given an access token and user id.",
  65. "operationId": "getUserById",
  66. "produces": [
  67. "application/json"
  68. ],
  69. "parameters": [
  70. {
  71. "in": "path",
  72. "name": "userId",
  73. "description": "The user id that needs to be fetched.",
  74. "required": true,
  75. "type": "string"
  76. }
  77. ],
  78. "responses": {
  79. "200": {
  80. "description": "successful operation",
  81. "schema": {
  82. "$ref": "#/definitions/User"
  83. }
  84. },
  85. "400": {
  86. "description": "User not found"
  87. }
  88. }
  89. }
  90. },
  91. "/users/{userId}/media/recent": {
  92. "get": {
  93. "tags": [
  94. "user"
  95. ],
  96. "summary": "Request the media that was recently posted by the user",
  97. "description": "This endpoint will return a list of the media that is uploaded by this user.",
  98. "operationId": "getMediaByUser",
  99. "produces": [
  100. "application/json"
  101. ],
  102. "parameters": [
  103. {
  104. "in": "path",
  105. "name": "userId",
  106. "description": "The user id whose media needs to be fetched.",
  107. "required": true,
  108. "type": "string"
  109. }
  110. ],
  111. "responses": {
  112. "200": {
  113. "description": "successful operation",
  114. "schema": {
  115. "$ref": "#/definitions/Media"
  116. }
  117. },
  118. "204": {
  119. "description": "The user has no media."
  120. },
  121. "400": {
  122. "description": "User not found"
  123. }
  124. }
  125. }
  126. },
  127. "/users/{userId}/follow": {
  128. "post": {
  129. "tags": [
  130. "user"
  131. ],
  132. "summary": "Follow a given user",
  133. "description": "Follow a given user on Instagram provided his user id",
  134. "operationId": "followUser",
  135. "produces": [
  136. "application/json"
  137. ],
  138. "parameters": [
  139. {
  140. "in": "path",
  141. "name": "userId",
  142. "description": "The currently logged in user.",
  143. "required": true,
  144. "type": "string"
  145. }
  146. ],
  147. "responses": {
  148. "200": {
  149. "description": "The user was successfully followed (or a request was sent to a private user to acquire permission."
  150. },
  151. "400": {
  152. "description": "Bad Request"
  153. },
  154. "404": {
  155. "description": "User to be followed not found"
  156. },
  157. "500": {
  158. "description": "Internal server error"
  159. }
  160. }
  161. }
  162. },
  163. "/users/{userId}/unfollow": {
  164. "delete": {
  165. "tags": [
  166. "user"
  167. ],
  168. "summary": "Unfollow a given user",
  169. "description": "Unfollow a given user on Instagram provided his user id",
  170. "operationId": "unfollowUser",
  171. "produces": [
  172. "application/json"
  173. ],
  174. "parameters": [
  175. {
  176. "in": "path",
  177. "name": "userId",
  178. "description": "The currently logged in user.",
  179. "required": true,
  180. "type": "string"
  181. }
  182. ],
  183. "responses": {
  184. "200": {
  185. "description": "The user was successfully unfollowed (or a request was sent to a private user to acquire permission."
  186. },
  187. "400": {
  188. "description": "Bad Request"
  189. },
  190. "404": {
  191. "description": "User to be unfollowed not found"
  192. },
  193. "500": {
  194. "description": "Internal server error"
  195. }
  196. }
  197. }
  198. },
  199. "/users/{userId}/followed-by": {
  200. "get": {
  201. "tags": [
  202. "user"
  203. ],
  204. "summary": "List of followers",
  205. "description": "return a list of the users that are following the authenticated user.",
  206. "operationId": "listOfFollowees",
  207. "produces": [
  208. "application/json"
  209. ],
  210. "parameters": [
  211. {
  212. "in": "path",
  213. "name": "userId",
  214. "description": "The user id for which you want to retrieve the followers.",
  215. "required": true,
  216. "type": "string"
  217. }
  218. ],
  219. "responses": {
  220. "200": {
  221. "description": "The list of followers was successfully retrieved.",
  222. "schema": {
  223. "$ref": "#/definitions/User"
  224. }
  225. },
  226. "204": {
  227. "description": "User has no followers"
  228. },
  229. "400": {
  230. "description": "User not found"
  231. }
  232. }
  233. }
  234. },
  235. "/users/{userId}/follows": {
  236. "get": {
  237. "tags": [
  238. "user"
  239. ],
  240. "summary": "List of followers",
  241. "description": "return a list of the users that the authenticated user is following.",
  242. "operationId": "listOfFollowers",
  243. "produces": [
  244. "application/json"
  245. ],
  246. "parameters": [
  247. {
  248. "in": "path",
  249. "name": "userId",
  250. "description": "The user id for which you want to retrieve the followers.",
  251. "required": true,
  252. "type": "string"
  253. }
  254. ],
  255. "responses": {
  256. "200": {
  257. "description": "The list of followers was successfully retrieved.",
  258. "schema": {
  259. "$ref": "#/definitions/User"
  260. }
  261. },
  262. "204": {
  263. "description": "User is not following anyone"
  264. },
  265. "400": {
  266. "description": "User not found"
  267. }
  268. }
  269. }
  270. },
  271. "/users/self/feed": {
  272. "get": {
  273. "tags": [
  274. "user"
  275. ],
  276. "summary": "Get users feed",
  277. "description": "return a list of media which the followees of the user have posted.",
  278. "operationId": "feed",
  279. "produces": [
  280. "application/json"
  281. ],
  282. "responses": {
  283. "200": {
  284. "description": "The list of media was successfully retrieved.",
  285. "schema": {
  286. "$ref": "#/definitions/Media"
  287. }
  288. },
  289. "204": {
  290. "description": "User is not following anyone"
  291. },
  292. "400": {
  293. "description": "There is no user authenticated"
  294. }
  295. }
  296. }
  297. },
  298. "/users/self/media/liked": {
  299. "get": {
  300. "tags": [
  301. "user"
  302. ],
  303. "summary": "Get users liked media",
  304. "description": "return a list of media which the user has liked.",
  305. "operationId": "mediaLiked",
  306. "produces": [
  307. "application/json"
  308. ],
  309. "responses": {
  310. "200": {
  311. "description": "The list of media was successfully retrieved.",
  312. "schema": {
  313. "$ref": "#/definitions/Media"
  314. }
  315. },
  316. "204": {
  317. "description": "User has not liked anything"
  318. },
  319. "400": {
  320. "description": "There is no user authenticated"
  321. }
  322. }
  323. }
  324. },
  325. "/media/{mediaId}": {
  326. "get": {
  327. "tags": [
  328. "media"
  329. ],
  330. "summary": "Request media",
  331. "description": "This endpoint will return basic media information given an access token and media id.",
  332. "operationId": "getMediaById",
  333. "produces": [
  334. "application/json"
  335. ],
  336. "parameters": [
  337. {
  338. "in": "path",
  339. "name": "mediaId",
  340. "description": "The media id that needs to be fetched.",
  341. "required": true,
  342. "type": "string"
  343. }
  344. ],
  345. "responses": {
  346. "200": {
  347. "description": "successful operation",
  348. "schema": {
  349. "$ref": "#/definitions/Media"
  350. }
  351. },
  352. "404": {
  353. "description": "media not found"
  354. }
  355. }
  356. }
  357. },
  358. "/media/{mediaId}/likes": {
  359. "get": {
  360. "tags": [
  361. "media"
  362. ],
  363. "summary": "Get likes for media",
  364. "description": "This endpoint will get all the like to the media specified by the media id.",
  365. "operationId": "GetLikeMediaById",
  366. "produces": [
  367. "application/json"
  368. ],
  369. "parameters": [
  370. {
  371. "in": "path",
  372. "name": "mediaId",
  373. "description": "The media id that will receive the like",
  374. "required": true,
  375. "type": "string"
  376. }
  377. ],
  378. "responses": {
  379. "200": {
  380. "description": "successful operation",
  381. "schema": {
  382. "$ref": "#/definitions/Media"
  383. }
  384. },
  385. "204": {
  386. "description": "The media has no liked"
  387. },
  388. "400": {
  389. "description": "Media not found"
  390. }
  391. }
  392. },
  393. "delete": {
  394. "tags": [
  395. "media"
  396. ],
  397. "summary": "Delete like for media",
  398. "description": "This endpoint will delete a like of the media specified by the media id.",
  399. "operationId": "DeleteMediaById",
  400. "produces": [
  401. "application/json"
  402. ],
  403. "parameters": [
  404. {
  405. "in": "path",
  406. "name": "mediaId",
  407. "description": "The media id for which the like will be deleted.",
  408. "required": true,
  409. "type": "string"
  410. }
  411. ],
  412. "responses": {
  413. "200": {
  414. "description": "successful operation",
  415. "schema": {
  416. "$ref": "#/definitions/Media"
  417. }
  418. },
  419. "204": {
  420. "description": "The user has never liked this media in the first place"
  421. },
  422. "400": {
  423. "description": "Media not found"
  424. }
  425. }
  426. },
  427. "put": {
  428. "tags": [
  429. "media"
  430. ],
  431. "summary": "Like media",
  432. "description": "This endpoint will post a like to the media specified by the media id.",
  433. "operationId": "LikeMediaById",
  434. "produces": [
  435. "application/json"
  436. ],
  437. "parameters": [
  438. {
  439. "in": "path",
  440. "name": "mediaId",
  441. "description": "The media id that will receive the like.",
  442. "required": true,
  443. "type": "string"
  444. }
  445. ],
  446. "responses": {
  447. "200": {
  448. "description": "successful operation",
  449. "schema": {
  450. "$ref": "#/definitions/Media"
  451. }
  452. },
  453. "204": {
  454. "description": "The user has already liked this media."
  455. },
  456. "400": {
  457. "description": "Media not found"
  458. }
  459. }
  460. }
  461. },
  462. "/media/{mediaId}/comments": {
  463. "get": {
  464. "tags": [
  465. "media"
  466. ],
  467. "summary": "Get media comments",
  468. "description": "This endpoint will get all the comments for the media specified by the media id.",
  469. "operationId": "getMediaById",
  470. "produces": [
  471. "application/json"
  472. ],
  473. "parameters": [
  474. {
  475. "in": "path",
  476. "name": "mediaId",
  477. "description": "The media id that is used to identify the media.",
  478. "required": true,
  479. "type": "string"
  480. }
  481. ],
  482. "responses": {
  483. "200": {
  484. "description": "successful operation",
  485. "schema": {
  486. "$ref": "#/definitions/Media"
  487. }
  488. },
  489. "204": {
  490. "description": "Media has no comments"
  491. },
  492. "400": {
  493. "description": "Media not found"
  494. }
  495. }
  496. }
  497. },
  498. "/media/{mediaId}/{commentId}": {
  499. "delete": {
  500. "tags": [
  501. "media"
  502. ],
  503. "summary": "Delete media comment",
  504. "description": "This endpoint will delete a comment on the media specified by the media id.",
  505. "operationId": "getMediaById",
  506. "produces": [
  507. "application/json"
  508. ],
  509. "parameters": [
  510. {
  511. "in": "path",
  512. "name": "mediaId",
  513. "description": "The media id that will identify the media.",
  514. "required": true,
  515. "type": "string"
  516. },
  517. {
  518. "in": "path",
  519. "name": "commentId",
  520. "description": "The comment id that will be deleted.",
  521. "required": true,
  522. "type": "string"
  523. }
  524. ],
  525. "responses": {
  526. "200": {
  527. "description": "successful operation",
  528. "schema": {
  529. "$ref": "#/definitions/Media"
  530. }
  531. },
  532. "204": {
  533. "description": "Comment not found"
  534. },
  535. "404": {
  536. "description": "Media not found"
  537. }
  538. }
  539. }
  540. },
  541. "/media/search/": {
  542. "get": {
  543. "tags": [
  544. "media"
  545. ],
  546. "summary": "Look for media ",
  547. "description": "This endpoint will look for media that match a given query",
  548. "operationId": "searchMediaByQuery",
  549. "produces": [
  550. "application/json"
  551. ],
  552. "parameters": [
  553. {
  554. "in": "query",
  555. "name": "lat",
  556. "description": "The latitude of the media to be queried.",
  557. "required": true,
  558. "type": "string"
  559. },
  560. {
  561. "in": "query",
  562. "name": "lng",
  563. "description": "The longitude of the media to be queried.",
  564. "required": true,
  565. "type": "string"
  566. }
  567. ],
  568. "responses": {
  569. "200": {
  570. "description": "successful operation",
  571. "schema": {
  572. "$ref": "#/definitions/Media"
  573. }
  574. },
  575. "204": {
  576. "description": "No media found"
  577. },
  578. "400": {
  579. "description": "Something went wrong when processing the request"
  580. }
  581. }
  582. }
  583. },
  584. "/media/popular/": {
  585. "get": {
  586. "tags": [
  587. "media"
  588. ],
  589. "summary": "Get for trending media ",
  590. "description": "This endpoint will look for the most popular media on instagram",
  591. "operationId": "getPopularMedia",
  592. "produces": [
  593. "application/json"
  594. ],
  595. "responses": {
  596. "200": {
  597. "description": "successful operation",
  598. "schema": {
  599. "$ref": "#/definitions/Media"
  600. }
  601. },
  602. "204": {
  603. "description": "No media found"
  604. },
  605. "400": {
  606. "description": "Something went wrong when processing the request"
  607. }
  608. }
  609. }
  610. },
  611. "/locations/{locationId}": {
  612. "get": {
  613. "tags": [
  614. "location"
  615. ],
  616. "summary": "Request location information",
  617. "description": "This endpoint will return basic location information and links to its media given an access token and location id.",
  618. "operationId": "getLocationById",
  619. "produces": [
  620. "application/json"
  621. ],
  622. "parameters": [
  623. {
  624. "in": "path",
  625. "name": "locationId",
  626. "description": "The location id that needs to be fetched.",
  627. "required": true,
  628. "type": "string"
  629. }
  630. ],
  631. "responses": {
  632. "200": {
  633. "description": "successful operation",
  634. "schema": {
  635. "$ref": "#/definitions/Location"
  636. }
  637. },
  638. "404": {
  639. "description": "Location not found"
  640. }
  641. }
  642. }
  643. },
  644. "/locations/search": {
  645. "get": {
  646. "tags": [
  647. "location"
  648. ],
  649. "summary": "Search for locations ",
  650. "description": "This endpoint will returns a list of locations that match for the given query.",
  651. "operationId": "getLocationById",
  652. "produces": [
  653. "application/json"
  654. ],
  655. "parameters": [
  656. {
  657. "in": "query",
  658. "name": "lat",
  659. "description": "The latitude of the location to be queried.",
  660. "required": true,
  661. "type": "string"
  662. },
  663. {
  664. "in": "query",
  665. "name": "lng",
  666. "description": "The longitude of the location to be queried.",
  667. "required": true,
  668. "type": "string"
  669. }
  670. ],
  671. "responses": {
  672. "200": {
  673. "description": "successful operation",
  674. "schema": {
  675. "$ref": "#/definitions/Location"
  676. }
  677. },
  678. "204": {
  679. "description": "There were no locations that matched this query"
  680. },
  681. "400": {
  682. "description": "Something went wrong when processing the request"
  683. }
  684. }
  685. }
  686. },
  687. "/locations/{locationId}/media/recent": {
  688. "get": {
  689. "tags": [
  690. "location"
  691. ],
  692. "summary": "Get a list of recent media",
  693. "description": "This endpoint will returns a list of recent media that were taken on this locations.",
  694. "operationId": "getRecentMediaLocationById",
  695. "produces": [
  696. "application/json"
  697. ],
  698. "parameters": [
  699. {
  700. "in": "path",
  701. "name": "locationId",
  702. "description": "The location that should be queried.",
  703. "required": true,
  704. "type": "string"
  705. }
  706. ],
  707. "responses": {
  708. "200": {
  709. "description": "successful operation",
  710. "schema": {
  711. "$ref": "#/definitions/Location"
  712. }
  713. },
  714. "204": {
  715. "description": "There were media for this locations"
  716. },
  717. "404": {
  718. "description": "Location was not found"
  719. }
  720. }
  721. }
  722. }
  723. },
  724.  
  725. "securityDefinitions": {
  726. "instagram_auth_key": {
  727. "type": "oauth2",
  728. "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",
  729. "flow": "implicit",
  730. "scopes": {
  731. "basic": "read any and all data related to a user",
  732. "comments": "Add or remove comments on a user's behalf",
  733. "relationships": "to follow and unfollow users on a user's behalf",
  734. "likes":" like and unlike items on a user's behalf"
  735. }
  736. }
  737. },
  738. "definitions": {
  739. "User": {
  740. "properties": {
  741. "id": {
  742. "type": "string"
  743. },
  744. "username": {
  745. "type": "string"
  746. },
  747. "fullName": {
  748. "type": "string"
  749. },
  750. "profilPicture": {
  751. "type": "string",
  752. "description": "Link to the users profile picture."
  753. },
  754. "bio": {
  755. "type": "string"
  756. },
  757. "website": {
  758. "type": "string",
  759. "description": "Link to users website."
  760. },
  761. "uploadCount": {
  762. "type": "integer",
  763. "format": "int32",
  764. "description": "Amount of media the user has uploaded."
  765. },
  766. "followers": {
  767. "type": "integer",
  768. "format": "int32",
  769. "description": "Amount of the followers the user has."
  770. },
  771. "followees": {
  772. "type": "integer",
  773. "format": "int32",
  774. "description": "Amount of users that is following the user."
  775. }
  776. }
  777. },
  778. "Comment": {
  779. "properties": {
  780. "id": {
  781. "type": "string"
  782. },
  783. "from": {
  784. "$ref": "#/definitions/User"
  785. },
  786. "date": {
  787. "type": "string",
  788. "format": "date-time"
  789. }
  790. }
  791. },
  792. "Image": {
  793. "properties": {
  794. "url": {
  795. "type": "string"
  796. },
  797. "width": {
  798. "type": "integer",
  799. "format": "int64"
  800. },
  801. "height": {
  802. "type": "integer",
  803. "format": "int64"
  804. }
  805. }
  806. },
  807. "Media": {
  808. "properties": {
  809. "type": {
  810. "type": "string",
  811. "description": "Descartes the media type (image or video)"
  812. },
  813. "usersInMedia": {
  814. "type": "array",
  815. "items": {
  816. "$ref": "#/definitions/User"
  817. }
  818. },
  819. "filter": {
  820. "type": "string",
  821. "description": "Filter used for this media"
  822. },
  823. "tags": {
  824. "type": "array",
  825. "items": {
  826. "type": "string"
  827. }
  828. },
  829. "comments": {
  830. "type": "array",
  831. "items": {
  832. "$ref": "#/definitions/Comment"
  833. }
  834. },
  835. "caption": {
  836. "type": "string"
  837. },
  838. "likes": {
  839. "type": "array",
  840. "items": {
  841. "$ref": "#/definitions/User"
  842. }
  843. },
  844. "date": {
  845. "type": "integer",
  846. "format": "int64"
  847. },
  848. "link": {
  849. "type": "string"
  850. },
  851. "user": {
  852. "$ref": "#/definitions/User"
  853. },
  854. "id": {
  855. "type": "integer",
  856. "format": "int32"
  857. },
  858. "image": {
  859. "$ref": "#/definitions/Image"
  860. },
  861. "location": {
  862. "$ref": "#/definitions/Location"
  863. }
  864. }
  865. },
  866. "Location": {
  867. "properties": {
  868. "id": {
  869. "type": "string"
  870. },
  871. "name": {
  872. "type": "string"
  873. },
  874. "latitude": {
  875. "type": "integer",
  876. "format": "int64"
  877. },
  878. "longitude": {
  879. "type": "integer",
  880. "format": "int64"
  881. }
  882. }
  883. }
  884. }
  885. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement