全數 API 之 URL 皆有 /api
前綴,如:http://vuse.tw/api/eggs/1
。
以下 URL 將省略 /api
前綴。
想法蛋之 API。
想法蛋之 status
狀態有 'new'
, 'pending'
, 'hatched'
與 'discarded'
四種,皆可由此 API 取得。注意 status = 'new' || 'discarded'
的想法蛋,應該只有作者本人或 superadmin
可以存取。
is_anonymous
決定想法蛋是否匿名。輸出 JSON 時,匿名想法蛋的 client_id
固定為 null
。
string
(required) Example: 1-hoping-never-fall想法蛋 slug / ID
string
(optional) Example: designer欄位列表,以 ,
分隔。
根據此處列出的欄位,從「欄位和此想法蛋相同」的想法蛋中,選出「前一個」和「下一個」想法蛋。
例:list=designer
時,會選出和當前想法蛋之設計師相同的想法蛋。
若為 no
,則 response 內不含 prev
與 next
。
Choices: collect
, channel
, designer
, client
string
(optional) Example: 3ID
若 list
中含有 collect
,則 ID 需為「收藏此想法蛋之使用者 ID」。
若 list
中含有 channel
,則 ID 需為「頻道 ID」。
200
Toggle{
egg: {
client_id: 54, /* 若 `is_anonymous` 為 true 則此欄為 `null` */
collector_count: 2,
color: "#444",
concept: "這是電影inception(全面啟動)的圖騰,在夢裡可以一直轉動而不會倒。夢總是讓人迷惑,而且往往和現實相背,不是嗎?",
concept_eng: "This is the totem of movie (inception), in the dream it can spin all day and never fall. Dreams always confuse us and always in contract with the fact.",
created_at: "2010-08-20T17:35:00+08:00",
designer_id: 1,
id: 1,
image: {
url: "/uploads/egg/image/1/e4e4292.jpg",
thumbnail: {
url: "/uploads/egg/image/1/thumbnail_e4e4292.jpg"
},
square: {
url: "/uploads/egg/image/1/square_e4e4292.jpg"
}
},
is_anonymous: false,
nickname: "柯柏",
offset_x: -23,
offset_y: -166,
order: 1,
payload: { },
reply_count: 0,
slug: "hoping-never-fall",
spice: "懷疑",
spice_eng: "doubt",
status: "hatched",
title: "Hoping never fall",
title_eng: "Hoping never fall",
updated_at: "2010-08-20T17:35:00+08:00",
view: "人人都希望永遠不倒,但永遠不倒終就只是個夢。",
view_eng: "Everyone wants never fall, but having no fall is a dream.",
client: {
avatar: {
url: null,
small: {
url: null
},
square: {
url: null
}
},
penname: "柯柏",
slug: "柯柏"
},
designer: {
avatar: {
url: "/uploads/user/avatar/1/3b1fae2.jpg",
small: {
url: "/uploads/user/avatar/1/small_3b1fae2.jpg"
},
square: {
url: "/uploads/user/avatar/1/square_3b1fae2.jpg"
}
},
penname: "Vuse Meiling",
slug: "vuse-meiling"
},
tags: [
{
id: 926,
created_at: "2014-02-11T01:51:36+08:00",
user_id: 1,
channel_id: 15,
channel: {
slug: "想像",
title: "想像"
}
}
]
},
prev: "吞下傷感",
next: "路平專暗",
related: [
{
slug: "le-bon-chemin",
image: "/uploads/egg/image/833/square_957e970.jpg"
},
{
slug: "breads-vacation",
image: "/uploads/egg/image/482/square_1d265d8.jpg"
},
{
slug: "鏡--2",
image: "/uploads/egg/image/664/square_7a74e3e.jpg"
},
{
slug: "出離",
image: "/uploads/egg/image/822/square_80fe9d6.jpg"
},
{
slug: "宇宙的秘密",
image: "/uploads/egg/image/1321/square_26141b0.jpg"
},
{
slug: "isolation",
image: "/uploads/egg/image/647/square_97ce14c.jpg"
},
{
slug: "breaking-dawn",
image: "/uploads/egg/image/992/square_4d9bb04.jpg"
}
]
}
必須要是此想法蛋的設計師,才能更新想法。
string
(required) 200
ToggleContent-Type: application/json
{
client_id: 54, /* 若 `is_anonymous` 為 true 則此欄為 `null` */
collector_count: 2,
color: "#444",
concept: "這是電影inception(全面啟動)的圖騰,在夢裡可以一直轉動而不會倒。夢總是讓人迷惑,而且往往和現實相背,不是嗎?",
concept_eng: "This is the totem of movie (inception), in the dream it can spin all day and never fall. Dreams always confuse us and always in contract with the fact.",
created_at: "2010-08-20T17:35:00+08:00",
designer_id: 1,
id: 1,
image: {
url: "/uploads/egg/image/1/e4e4292.jpg",
thumbnail: {
url: "/uploads/egg/image/1/thumbnail_e4e4292.jpg"
},
square: {
url: "/uploads/egg/image/1/square_e4e4292.jpg"
}
},
is_anonymous: false,
nickname: "柯柏",
offset_x: -23,
offset_y: -166,
order: 1,
payload: { },
reply_count: 0,
slug: "hoping-never-fall",
spice: "懷疑",
spice_eng: "doubt",
status: "hatched",
title: "Hoping never fall",
title_eng: "Hoping never fall",
updated_at: "2010-08-20T17:35:00+08:00",
view: "人人都希望永遠不倒,但永遠不倒終就只是個夢。",
view_eng: "Everyone wants never fall, but having no fall is a dream.",
client: {
avatar: {
url: null,
small: {
url: null
},
square: {
url: null
}
},
penname: "柯柏",
slug: "柯柏"
},
designer: {
avatar: {
url: "/uploads/user/avatar/1/3b1fae2.jpg",
small: {
url: "/uploads/user/avatar/1/small_3b1fae2.jpg"
},
square: {
url: "/uploads/user/avatar/1/square_3b1fae2.jpg"
}
},
penname: "Vuse Meiling",
slug: "vuse-meiling"
},
tags: [
{
id: 926,
created_at: "2014-02-11T01:51:36+08:00",
user_id: 1,
channel_id: 15,
channel: {
slug: "想像",
title: "想像"
}
}
]
}
送出新想法時,若沒有登入,會回傳 401。若資料有物,會回傳 422。
object
(required) 想法蛋物件。
boolean
(required) Example: false是否要匿名。
text
(required) 匿名想法蛋的暱稱。
text
(required) 情緒調味料。
text
(required) 想說的話。
object
(optional)
number
(required) 想法蛋色相,0
~360
。
array
(optional) Example: [1,3,6]想法蛋收錄頻道 ID。
Content-Type: application/json
{"egg":{"is_anonymous":false,"nickname":"MrOrz","spice":"情緒調味料","view":"想說的話喔"},"hue":83.23529411764706,"channels":[24,27]}
200
ToggleContent-Type: application/json
{
client_id: 54, /* 若 `is_anonymous` 為 true 則此欄為 `null` */
collector_count: 2,
color: "#444",
concept: "這是電影inception(全面啟動)的圖騰,在夢裡可以一直轉動而不會倒。夢總是讓人迷惑,而且往往和現實相背,不是嗎?",
concept_eng: "This is the totem of movie (inception), in the dream it can spin all day and never fall. Dreams always confuse us and always in contract with the fact.",
created_at: "2010-08-20T17:35:00+08:00",
designer_id: 1,
id: 1,
image: {
url: "/uploads/egg/image/1/e4e4292.jpg",
thumbnail: {
url: "/uploads/egg/image/1/thumbnail_e4e4292.jpg"
},
square: {
url: "/uploads/egg/image/1/square_e4e4292.jpg"
}
},
is_anonymous: false,
nickname: "柯柏",
offset_x: -23,
offset_y: -166,
order: 1,
payload: { },
reply_count: 0,
slug: "hoping-never-fall",
spice: "懷疑",
spice_eng: "doubt",
status: "hatched",
title: "Hoping never fall",
title_eng: "Hoping never fall",
updated_at: "2010-08-20T17:35:00+08:00",
view: "人人都希望永遠不倒,但永遠不倒終就只是個夢。",
view_eng: "Everyone wants never fall, but having no fall is a dream.",
client: {
avatar: {
url: null,
small: {
url: null
},
square: {
url: null
}
},
penname: "柯柏",
slug: "柯柏"
},
designer: {
avatar: {
url: "/uploads/user/avatar/1/3b1fae2.jpg",
small: {
url: "/uploads/user/avatar/1/small_3b1fae2.jpg"
},
square: {
url: "/uploads/user/avatar/1/square_3b1fae2.jpg"
}
},
penname: "Vuse Meiling",
slug: "vuse-meiling"
},
tags: [
{
id: 926,
created_at: "2014-02-11T01:51:36+08:00",
user_id: 1,
channel_id: 15,
channel: {
slug: "想像",
title: "想像"
}
}
]
}
401
Toggle{
error: "Should login first"
}
422
ToggleContent-Type: application/json
{
client_id: 54, /* 若 `is_anonymous` 為 true 則此欄為 `null` */
collector_count: 2,
color: "#444",
concept: "這是電影inception(全面啟動)的圖騰,在夢裡可以一直轉動而不會倒。夢總是讓人迷惑,而且往往和現實相背,不是嗎?",
concept_eng: "This is the totem of movie (inception), in the dream it can spin all day and never fall. Dreams always confuse us and always in contract with the fact.",
created_at: "2010-08-20T17:35:00+08:00",
designer_id: 1,
id: 1,
image: {
url: "/uploads/egg/image/1/e4e4292.jpg",
thumbnail: {
url: "/uploads/egg/image/1/thumbnail_e4e4292.jpg"
},
square: {
url: "/uploads/egg/image/1/square_e4e4292.jpg"
}
},
is_anonymous: false,
nickname: "柯柏",
offset_x: -23,
offset_y: -166,
order: 1,
payload: { },
reply_count: 0,
slug: "hoping-never-fall",
spice: "懷疑",
spice_eng: "doubt",
status: "hatched",
title: "Hoping never fall",
title_eng: "Hoping never fall",
updated_at: "2010-08-20T17:35:00+08:00",
view: "人人都希望永遠不倒,但永遠不倒終就只是個夢。",
view_eng: "Everyone wants never fall, but having no fall is a dream.",
client: {
avatar: {
url: null,
small: {
url: null
},
square: {
url: null
}
},
penname: "柯柏",
slug: "柯柏"
},
designer: {
avatar: {
url: "/uploads/user/avatar/1/3b1fae2.jpg",
small: {
url: "/uploads/user/avatar/1/small_3b1fae2.jpg"
},
square: {
url: "/uploads/user/avatar/1/square_3b1fae2.jpg"
}
},
penname: "Vuse Meiling",
slug: "vuse-meiling"
},
tags: [
{
id: 926,
created_at: "2014-02-11T01:51:36+08:00",
user_id: 1,
channel_id: 15,
channel: {
slug: "想像",
title: "想像"
}
}
]
}
目前登入之使用者,必須要有「設計師」身分(:designer
in roles
)才能發佈想法蛋。
string
(required) 200
ToggleContent-Type: application/json
{
client_id: 54, /* 若 `is_anonymous` 為 true 則此欄為 `null` */
collector_count: 2,
color: "#444",
concept: "這是電影inception(全面啟動)的圖騰,在夢裡可以一直轉動而不會倒。夢總是讓人迷惑,而且往往和現實相背,不是嗎?",
concept_eng: "This is the totem of movie (inception), in the dream it can spin all day and never fall. Dreams always confuse us and always in contract with the fact.",
created_at: "2010-08-20T17:35:00+08:00",
designer_id: 1,
id: 1,
image: {
url: "/uploads/egg/image/1/e4e4292.jpg",
thumbnail: {
url: "/uploads/egg/image/1/thumbnail_e4e4292.jpg"
},
square: {
url: "/uploads/egg/image/1/square_e4e4292.jpg"
}
},
is_anonymous: false,
nickname: "柯柏",
offset_x: -23,
offset_y: -166,
order: 1,
payload: { },
reply_count: 0,
slug: "hoping-never-fall",
spice: "懷疑",
spice_eng: "doubt",
status: "hatched",
title: "Hoping never fall",
title_eng: "Hoping never fall",
updated_at: "2010-08-20T17:35:00+08:00",
view: "人人都希望永遠不倒,但永遠不倒終就只是個夢。",
view_eng: "Everyone wants never fall, but having no fall is a dream.",
client: {
avatar: {
url: null,
small: {
url: null
},
square: {
url: null
}
},
penname: "柯柏",
slug: "柯柏"
},
designer: {
avatar: {
url: "/uploads/user/avatar/1/3b1fae2.jpg",
small: {
url: "/uploads/user/avatar/1/small_3b1fae2.jpg"
},
square: {
url: "/uploads/user/avatar/1/square_3b1fae2.jpg"
}
},
penname: "Vuse Meiling",
slug: "vuse-meiling"
},
tags: [
{
id: 926,
created_at: "2014-02-11T01:51:36+08:00",
user_id: 1,
channel_id: 15,
channel: {
slug: "想像",
title: "想像"
}
}
]
}
未孵化想法蛋列表
200
Generated by aglio on 01 May 2014