Skip to content

Instantly share code, notes, and snippets.

@khanzadyan
Created May 22, 2015 09:36
Show Gist options
  • Save khanzadyan/7b7f7655f3019613c9ca to your computer and use it in GitHub Desktop.
Save khanzadyan/7b7f7655f3019613c9ca to your computer and use it in GitHub Desktop.
Sample component JSON
{
"title": "Twitter",
"description": "Twitter API Integration",
"credentials" : {
"fields":{
"oauth":{
"viewClass":"OAuthFieldView",
"label":"Twitter Account",
"required" : true
}
},
"oauth1":{
"consumer_key":"{{TWITTER_API_KEY}}",
"consumer_secret":"{{TWITTER_API_SECRET}}",
"request_token_uri":"https://api.twitter.com/oauth/request_token",
"auth_uri":"https://api.twitter.com/oauth/authorize",
"access_token_uri":"https://api.twitter.com/oauth/access_token"
}
},
"triggers": {
"mentions_timeline": {
"title": "Get Mentions Timeline",
"main": "./mentions_timeline.js",
"type":"polling",
"metadata": {
"out":"./tweet.json"
}
},
"user_timeline": {
"title": "Get User's Timeline",
"main": "./user_timeline.js",
"type":"polling",
"fields":{
"screenName":{
"viewClass":"TextFieldView",
"label":"Screen Name",
"required": true
}
},
"metadata": {
"out":"./tweet.json"
}
}
},
"actions": {
"new_direct_message": {
"title": "Send a new direct message to a user",
"main": "new_direct_message.js",
"metadata": {
"in": {
"type": "object",
"properties": {
"screenName": {
"type": "string",
"title": "Screen Name",
"id": "text",
"required": true
},
"text": {
"type": "string",
"title": "Text",
"id": "text",
"required": true,
"maxLength": 140
}
}
},
"out":{
"type":"object",
"properties":{
"id": {
"title": "Twitter Message Id",
"type":"number",
"id": "id",
"required":false
},
"recipient_screen_name": {
"title": "Recipient Screen Name",
"type":"string",
"id": "recipient_screen_name",
"required":false
},
"sender_screen_name": {
"title": "sender_screen_name Screen Name",
"type":"string",
"id": "sender_screen_name",
"required":false
},
"text": {
"title": "Message Text",
"type":"string",
"id": "text",
"required":false
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment