Create idea
Working with Idea
In Benlly Platform, an “Idea” is a set of instruction provided by user. It consist of “Trigger” – which is the condition under which the “Idea” will be executed, and “Action” – which is the action that the platform will take when the condition set in “Trigger” is met.
Create User Idea
Execute the process of creating Idea by making a POST request to endpoint /api/v0.9/ideas .
Request Header
Request Headers
Name |
Description |
Type |
Example |
Authorization |
Access token of user. In the format ‘Bearer xxxxxxxxxxx’ |
String |
Bearer <access_token> |
X-Benlly-Request-Device |
Type of the device in use. Available options included
- ios
- android
- web
- infoboard
- windows
|
String |
android |
X-Benlly-Udid |
Unique ID for each device. Could be generated by using SDK. |
String |
7f0abbcd-fb03-4484-aaba-a0211d9c14e2 |
URL Parameters
There are no required URL Parameters.
Request Parameters
Request Parameters
Name |
Description |
Type |
oauth_client_idea_id |
If this Idea was created base on a pre-set Idea, this field should contain its ID. If not, then leave NULL. |
String |
Trigger |
An Trigger Object. Description below. |
Object |
Actions |
An array of Action Object. Description below. |
Array |
executed_days |
An array of Integer, specify which days of week should this idea be executed. |
Array |
executed_time |
Specify at which time of day should this idea be executed. |
String |
Trigger Object
Name |
Description |
Type |
device_ids |
An array of Integer, contains the IDs of all UserChannel that user want to use. |
Array |
schema |
A Schema Object. Description below. |
Object |
Items |
An array that describe the user input content of the trigger. Each member is an array in the following format.
- name : Name of this item. Type String. For example : ‘hashtag’
- value : Content of this item. Type Mix. For example : ‘{海}’
|
Array |
Action Object
Name |
Description |
Type |
device_ids |
An array of Integer, contains the IDs of all UserChannel that user want to use. |
Array |
schema |
A Schema Object. Description below. |
Object |
Items |
An array that describe the user input content of the action. Each member is an array in the following format.
- name : Name of this item. Type String. For example : ‘message’
- value : Content of this item. Type Mix. For example : ‘{{ツイート内容}}’
|
Array |
Schema Object
Name |
Description |
Type |
id |
ID of the action or trigger that this UserTrigger or UserAction based on. |
Integer |
Response Format
In case of successful, the server will return an UserIdea Object. Response will be of following format :
Sample Response
{
data: {
id: 123,
oauth_client_idea: {
id: 1,
name: 'My Idea',
icon: '/img/default.png',
used: true,
}
trigger: {
id: 22,
schema: {
id: 2,
identifier: "post_with_hashtag",
title: "あなたが特定のハッシュタグつきのツイートをしたら"
items: [
{
"name": "hashtag",
"label"; "ハッシュタグ"
"type": "text",
"max": 128
}
],
keywords: [
{
"name": "id",
"label": "ツイートID",
"type": "text",
},
{
"name": "contents",
"label": "ツイート内容",
"type": "text",
},
{
"name": "posted_at",
"label": "ツイート日時",
"type": "datetime",
}
]
},
title: "あなたが #海 のツイートをしたら",
items: [
{
"name": "hashtag",
"label"; "ハッシュタグ"
"type": "text",
"value": "海",
"max": 128
}
]
},
actions: [
{
id: 12,
title: "ツイートする",
schema: {
id: 1,
identifier: "post",
title: "ツイートする"
items: [
{
"name": "message",
"label"; "ツイート内容"
"type": "text",
"max": 140
}
]
},
items: [
{
"name": "message",
"label"; "ツイート内容"
"type": "text",
"value": "{{投稿内容}}"
"max": 140
}
]
}
],
used: false,
status: "available",
last_executed_at: "2016-10-02T12:15:00+09:00",
last_manual_executed_at: null,
created_at: "2016-10-01T12:30:31+09:00",
updated_at: "2016-10-01T12:30:31+09:00"
}
}