IMified API
An application connected to the IMified platform is in its simplest form a dynamic web page that resides on any HTTP server and listens for incoming messages then outputs a response. You specify an endpoint URL in your bots’ settings. Developers may also "push" messages to users, as well as request a users presence via a REST api call to IMified’s server.
Receiving and Replying to Incoming Messages
When a user sends a message to your bot, IMified will forward the message along with some other post variables to a URL on your server. The table below outlines the post variables you can expect to receive.
botkey
botkey uniquely identifies the bot that the message is being sent to.
userkey
userkey uniquely identifies a user of your bot and can be used for instance, to associate the IM user with a user in your system. Userkey is variable length, no greater than 50 characters.
network
Possible values are:
Jabber, AIM, MSN, Yahoo, Gtalk, Twitter or SMS
user
user is the actual screen name of the user calling your bot
channel
Possible values are: public or private
Default: private
Primarily used to distinguish public @replies and private direct messages for twitter
msg
msg is the text of the message sent to your bot. This field is useful for quickly reading the value of the current message sent. For bots that are command based as opposed to "menu driven", and do not need to maintain "state", the msg variable can be used to read and respond to commands sent to your bot.
step
step is a numeric value which represents what step the user is on and is incremented each time a call to the bot is made. For instance, when an IM user first sends a message to your bot, the step variable will be 1. The second message sent will have a step value of 2 and so on, until you reset the bot or provide a function for your user to reset the bot.
valuex
value1 – valuex are the values entered by the end user for each respective step. These variables along with the step variable can be used to maintain state in your bot.