Api - m3hack2/cococlip GitHub Wiki

API 仕様

投稿

Request

POST /api/1/clips

画像をつける場合 multipart で乗せる。

  • title
  • body
  • lat
  • lon
  • image1
  • image2

Response

作成できた場合 201 Created で、作成したクリップの ID を返す。

{ "id": "XXXXXXXXXX" }

クリップ詳細

Request

GET /api/1/clips/XXXXXXXXXX

Response

あった場合 200 OK 、なかった場合 404 Not Found を返す。

{ "id": "XXXXXXXXXX", "title": "XXX", "body": "XXX", "lat": XXX.XX, "lon": XXX.XX, "low_image1_url": "http://", "high_image1_url": "http://" , "low_image2_url": "http://", "high_image2_url": "http://" }

クリップ検索

Request

GET /api/1/clips
  • lat
  • lon

Response

本文は返さない。

{
  "results": [
    { "id": "XXXXXXXXXX", "title": "XXX", "lat": XXX.XX, "lon": XXX.XX, "low_image1_url": "http://", "high_image1_url": "http://" , "low_image2_url": "http://", "high_image2_url": "http://" },
    { "id": "XXXXXXXXXX", "title": "XXX", "lat": XXX.XX, "lon": XXX.XX, "low_image1_url": "http://", "high_image1_url": "http://" , "low_image2_url": "http://", "high_image2_url": "http://" },
    { "id": "XXXXXXXXXX", "title": "XXX", "lat": XXX.XX, "lon": XXX.XX, "low_image1_url": "http://", "high_image1_url": "http://" , "low_image2_url": "http://", "high_image2_url": "http://" }
  ]
}