Only authenticated Twitter users are allowed access to any endpoints.
Description | Endpoint |
---|---|
Login OAuth | GET /authenticate |
Logout User | GET /logout |
Get Generated Tweets | GET /tweets/generated |
Get Scheduled Tweets | GET /tweets/scheduled |
Get Posted Tweets | GET /tweets/posted |
Modify Tweet | PUT /tweets/:id |
Post Tweet | POST /tweets/:id |
Schedule Tweet | POST /tweets/schedule/:id |
Trash Tweet | DELETE /tweets/:id |
Get Templates | GET /templates |
Get Template | GET /templates/:id |
Post Template | POST /templates/:id |
Edit Template | PUT /templates/:id |
Delete Template | DELETE /templates/:id |
Redirects back to server after acquiring access token, tokenSecret, and userID after User approves OAuth permission through Twitter.
Logs out user from session and clears out cookies.
Request sent when user loads up dashboard and retrieves generated tweets to display.
Returns json
[
{
"bot_tweet_id":70,
"user_twitter_id":"10950502",
"tweet_status":"available",
"retweet_count":null,
"favorite_count":null,
"user_screen_name":null,
"user_followers_count":null,
"tweet_text":null,
"tweet_id_str":null,
"bot_tweet_body":"💩 shoe",
"news_headline":null,
"created_at":"2016-05-19T20:59:02.873Z",
"updated_at":"2016-05-19T20:59:02.873Z",
"schedule_id":null
},
//...
]
Request sent when user loads up scheduled tweets page to display tweets to be posted later.
Returns json.
[
{
"bot_tweet_id":51,
"user_twitter_id":"10950502",
"tweet_status":"scheduled",
"retweet_count":null,
"favorite_count":null,
"user_screen_name":null,
"user_followers_count":null,
"tweet_text":null,
"tweet_id_str":null,
"bot_tweet_body":"💩 shoe",
"news_headline":"Twitter, Trump’s Trusty Weapon, Could Backfire",
"created_at":"2016-05-18T23:00:21.853Z",
"updated_at":"2016-05-19T20:59:02.873Z",
"schedule_id":17,
"scheduled_time": "2016-05-20T01:49:37.148Z"
},
// ...
]
Request sent when user loads up scheduled tweets page to display history of posted bot tweets.
[
{
"original_tweet_id":"733018074480312320",
"original_tweet_props":"",
"retweet_count":0,
"retweet_id":"733105106564976640",
"tweet_id":8,
"tweet_text":"https://t.co/9h9RhyEHIi",
"user_twitter_id":"10950502",
"created_at":"2016-05-19T01:20:52.000Z",
"updated_at":"2016-05-19T01:20:52.580Z"
},
// ...
]
Request sent when User edits a generated tweet. Id param refers to tweet ID.
{
"tweet": "Please edit bot_tweet_body"
}
returns bot_tweet_id of the edited tweet
[185]
Request sent when User approves and posts generated tweet to Twitter. Id params refers to tweet ID.
return retweet_id
[12]
Request sent when User schedules a tweet to be posted later. Modifies the tweet's tweet_status to 'scheduled' and creates an entry in the scheduledtweets table with scheduled_time in UNIX time format.
{
"schedule": "1463763702"
}
Returns array of tweet_status.
["scheduled"]
Request sent when User trashes generated tweet. Modifies tweet's tweet_status to 'trashed'. Id params refers to bot_tweet_id.
Returns array of tweet_status.
["trashed"]
When User loads dashboard to retrieve template IDs from database.
Returns an array of User's templates with IDs and names.
[
{
"name":"News",
"template_id": 3
},
{
"name": "My Emojis",
"template_id": 1
}
// ...
]
Request sent when user selects template to display.
{
"template_id": 3,
"template": [ "chunkType":"news", "id": 1, "params": { "keyword:"trump" } ],
"name": "News",
"active": true,
"user_twitter_id": "10950502"
}
Request sent when User saves template. Id params refers to bot_tweet_id.
Returns retweet_id
[12]
Request sent when User edits template. Id params refers to template ID
Returns template name that was updated.
["Updated Template Name"]
Request sent when User deletes template. Id params refers to template ID.
Confirms deletion.
"you deleted it"